/dist/server.js run without errors.
Throws error "SyntaxError: Unexpected token ." on this generated row:
module.exports = ./../../frontend/website/node_modules/webpack/buildin/module.js;
- [ ] aspnetcore-engine
- [ ] common
- [x] express-engine
- [ ] hapi-engine
- [x] module-map-ngfactory-loader
I can't reproduce the error from e.g. universal-starter. The same line doesn't get generated from there :(
See comments in last question.
@nguniversal versions
Angular CLI: 6.0.8
Node: 8.10.0
OS: darwin x64
Angular: 6.0.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cdk 6.0.0
@angular/cli 6.0.8
@angular/material 6.0.0
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
webpack 4.8.3
I realize this might not be an Angular/Universal issue, really. But I've been searching the web for hours to find any clues on this and I'm just simply stuck. Need to elaborate some thoughts.
Like...
I've never seen this export syntax, using the file path without require(). Is it valid? In what ES-syntax or NodeJS version (maybe I'm using wrong)?
If I change the line to one of the following, the server starts without errors:
module.exports = require('webpack/buildin/module.js');
module.exports = require('./../../../frontend/website/node_modules/webpack/buildin/module.js');
Again - is the generated syntax valid?
The second line works with an additional '../'. Is the generated path incorrect or has this new bare-path-syntax different relative path than e.g. require()?
Any thoughts is appreciated.
is the generated syntax valid
Nope, that generated path is not a valid import or require.
There's not really much I can do without a minimal reproduction or some more details on the topic
@Toxicable asked for a reproduction months ago. If one is provided we can reopen this issue.
@denkan I had the same issue. After installing webpack-cli locally it worked.
I'm having the same problem, installing webpack-cli locally didn't fix it for me..
here's a reproducible repo https://github.com/khaledosman/advanced-angular-features-demo/tree/ssr-implementation
Steps to reproduce:
npm run-script ssr:dev from the client/ directory or webpack --config webpack.server.config.js && node dist/server.js from the server/ directorySame problem here! Please can anyone check this error with the repo provided!?
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Same problem here! Please can anyone check this error with the repo provided!?