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
@nrwl/web:build does not work with webpack 5 #4627
Comments
Are there any workarounds? |
+1, still looks like an issue. No easy workaround as far as I see, at a quick glance. |
I'm trying to implement the correct format of |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
This is still very much an issue, and a blocker for us to use Nx. Would love to see it make into the tools soon |
Any updates on this? Still an issue with 12.0.8 |
One dreadful way around this is to download webpack 4 under an alias
Then add a
Then you can build the application |
I was taking a look at this yesterday. To fix this, NX needs to upgrade the base app to Webpack 5, which will cause some issues then remove https://github.com/nrwl/nx/blob/master/packages/web/src/utils/third-party/cli-files/plugins/named-chunks-plugin.ts this file then inside the common.ts file (https://github.com/nrwl/nx/blob/master/packages/web/src/utils/third-party/cli-files/models/webpack-configs/common.ts) and make a tweak to the optimization section:
But then the run-webpack.ts will also need tweaking :/ not managed to solve that issue yet. Appears one of the function doesn't return the correct type :( |
@Jordan-Hall correct, they are currently incompatible. The only way round it to patch it or "trick" it by giving You can either do it as stated [above(https://github.com//issues/4627#issuecomment-825797960) or you could prob do it with yarn and For example: "resolutions": {
"**/@nrwl/web/webpack": "4.46.0"
}, Obviously, this only works if your |
Are they a reason we cant upgrade the whole of NX to Webpack 5? I don't mind carrying on working on it due to a requirement for a client. |
It's on the roadmap - there are also quite a few inconsistencies with the storybook plugin too |
Version
|
@FrozenPandaz qq why is there a |
If i try to upgrade to webpack 5 i get this:
which is this line:
which is referred to here: |
Any news on this? With webpack5 now being the default for angular apps I just ran into this issue upgrading the workspace |
Same problem here, fresh app created with 'nx generate @nrwl/web:app myapp' nwrl/web 12.5.8 |
Hi everyone, I have the same issue, any update that can help us? |
Somehow managed to break my setup with this too (I am on NX 11), seems NX 12 allows to manually enable Webpack5 |
@JustusNBB after running
any workaround to this issue? |
after upgrading to NX 13 still getting a similar issue: any workaround for this? |
I think the builder is called @nrwl/web:webpack now @keshav-kishor |
Thanks, @kamshak it worked |
is this issue still open? I am seeing an error like this |
I have the same issue with a react application :/ |
Tested in 14.x Executors have been renamed "executor": "@nrwl/node:execute" -> "executor": "@nrwl/node:node" also applies for web:build -> web:webpack see AliYusuf95 reply here: #9168 |
This is still not working for me using new webpack.EnvironmentPlugin(ENV_VAR_ALLOW_LIST) I'm getting the following error:
|
This has been fixed a while back. If you are still using We only support Webpack 5 now, not Webpack 4. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Running
yarn nx build <project_name>
withwebpack@5.18.0
on a React app, gives the following error:Expected Behavior
It should successfully build the React app.
Steps to Reproduce
yarn
yarn nx build <project_name>
Failure Logs
Here is the full error log:
Environment
The text was updated successfully, but these errors were encountered: