-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in SSR if server build with bundleDependencies=all
#12273
Comments
I think what's happening here, is that you have 2 instances of One in the //cc @vikerman |
Is it related to #8616 ? |
It seems it is a duplicate of #8616. |
Have a repro. First need to figure out why JitCompiler is getting involved at all since we pass in the NgFactory to the express engine. |
@vikerman Any update on this issue or workaround? I'm running into it with latest Angular CLI and this seems to be a hard blocker atm. |
I'm running against the same problems. |
@vikerman @MarkPieszak, would you have a look? |
On it (again). Investigating the root cause. |
@vikerman I'm at a point where we really need it. So my plan was to bundle it myself with webpack.
I tried to debug it a bit, but I'm not knowable of the internal workings of Angular itself. |
@vikerman When using I removed the check locally to see if it would magically work. But it seems we then have a whole bunch of other errors. So I assume the generated webpack bundle is 'wrong'. My knowledge of webpack is also to limited to say something useful (I tried to compare the bundles, but I couldn't really make much of it) |
We were ending up with two copies of Angular due to the bundling setup we have for express-engine. We think we finally have a solution(See PR above) and turning on bundleDependencies on by default for version 8.0 of @nguniversal/express-engine. Still end up with a dist/server.js and dist/server/main.js (and dist/server/*.js for dynamic import based lazy routes) - But that's still lot better than shipping entire node_modules. |
@ErazerBrecht - We think we have a solution for version 8.0. |
@vikerman Thx for update! |
Was this fixed with 8.2 ? |
The new 8.x versions of @nguniversal/express-engine schematics creates a setup which avoid this issue. If you are upgrading to 8.x version please follow https://github.com/angular/universal/blob/master/docs/v8-upgrade-guide.md |
Would it work with ASP. Net/.Net Core? Can you please add instructions for that in readme docs? |
@naveedahmed1, yeah this should also work for the .net implementation. You’d need to export Closing this issue as it should be solved as per @vikerman’s comment. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
Angular CLI: 6.2.1
Node: 8.11.2
OS: darwin x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
@angular-devkit/architect 0.8.1
@angular-devkit/build-angular 0.8.1
@angular-devkit/build-ng-packagr 0.8.1
@angular-devkit/build-optimizer 0.8.1
@angular-devkit/build-webpack 0.8.1
@angular-devkit/core 0.8.1
@angular-devkit/schematics 0.8.1
@angular/cdk 6.4.7
@angular/cli 6.2.1
@angular/flex-layout 6.0.0-beta.18
@angular/material 6.4.7
@angular/pwa 0.8.1
@ngtools/json-schema 1.1.0
@ngtools/webpack 6.2.1
@schematics/angular 0.8.1
@schematics/update 0.8.1
ng-packagr 4.1.1
rxjs 6.3.2
typescript 2.9.2
webpack 4.18.0
Repro steps
I use
universal-starter
, only change one line inangular.json
:Access
http://localhost:4000
in browser.The log given by the failure
Desired functionality
bundleDependencies=all
should work as same asbundleDependencies=none
.Mention any other details that might be useful
No.
The text was updated successfully, but these errors were encountered: