Skip to content

1.5.0's new --bundle-dependencies=all causes build warnings out of the box #8035

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

Closed
SteveSandersonMS opened this issue Oct 12, 2017 · 9 comments
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@SteveSandersonMS
Copy link

SteveSandersonMS commented Oct 12, 2017

Firstly, thanks again to @hansl for implementing --bundle-dependencies.

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

1.5.0-rc.0

Repro steps.

  • npm install -g @angular/[email protected]
  • ng new MyApp
  • cd MyApp
  • Open your code editor, and modify .angular-cli.json to add "platform": "server" to the config for the app.
  • ng build --prod --bundle-dependencies=all

Expected: Build completes without warnings/errors

Actual:

WARNING in ./node_modules/@angular/core/bundles/core.umd.js
5691:15-36 Critical dependency: the request of a dependency is an expression
    at ImportLazyContextDependency.getWarnings (dir\MyApp\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18)
    at Compilation.reportDependencyErrorsAndWarnings (dir\MyApp\node_modules\webpack\lib\Compilation.js:701:24)

... plus many more lines of warnings.

Desired functionality.

Builds without errors/warnings in the default case for platform: server and --bundle-dependencies=all.

Mention any other details that might be useful.

In @angular/cli 1.4.x, it was possible to make fully-bundled server builds work without errors by modifying the node_modules/@angular/cli/models/webpack-configs/ files in two ways:

  1. By changing server.js to set externals to an empty array
  2. By changing production.js so that UglifyJsPlugin was not added to the plugins array for server builds.

However, in 1.5.0-rc.0, the Critical dependency: the request of a dependency is an expression warnings still happen regardless of UglifyJsPlugin. So something else must have changed in 1.5.0 to trigger these additional warnings.

@filipesilva filipesilva added needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Oct 16, 2017
@irowbin
Copy link

irowbin commented Nov 10, 2017

I am also getting this warning as well after I updated to Angular v5. No warning when I downgrade Angular v4xx but, After v5 I am seeing this warning.

@muradm
Copy link
Contributor

muradm commented Dec 10, 2017

+1

@chamikasandamal
Copy link

Getting this issue in @angular/[email protected] as well

@naveedahmed1
Copy link

Any update on this?

@hansl hansl removed their assignment Feb 6, 2018
@speige
Copy link

speige commented Feb 22, 2018

+1

@speige
Copy link

speige commented Mar 15, 2018

In my case I get the same "Critical dependency: the request of a dependency is an expression". However, I simply ignore it & everything seems to work fine. I haven't noticed any bugs/issues caused by it in production.

I have --bundle-dependencies=all turned on, latest build of angular 5, & I use serverSideRendering/universal (using a .net core backend on windows server+iis) in my app without copying node_modules to my production server.

@mikila85
Copy link

+1

@alan-agius4
Copy link
Collaborator

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

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.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

10 participants