You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from 9.0.4 to 9.0.5, dynamic(() => import()) are now all merged into commons.js, and no chunks are exported. Before it would create a new chunk for each.
It only happens when building for prodution with target: serverless. Running in development, the chunks are still generated correctly
Example
I've created a simple Codesandbox that just adds a single import(). It correctly chunks and loads the chunk on 9.0.4.
5ad0ea8e5b426183601cc28e98f158bcf2d0c524 is the first bad commit
commit 5ad0ea8e5b426183601cc28e98f158bcf2d0c524
Author: Joe Haddad <timer150@gmail.com>
Date: Tue Aug 20 12:38:14 2019 -0400
Remove `__NEXT_REPLACE__BUILD_ID__` workaround (#8445)
We no longer need this because we don't run terser on serverless bundles.
---
Closes https://github.com/zeit/next.js/issues/8436
packages/next/build/entries.ts | 1 +
packages/next/build/webpack-config.ts | 6 +-
.../webpack/loaders/next-serverless-loader.ts | 4 +-
.../build/webpack/plugins/serverless-plugin.ts | 96 +++-------------------
4 files changed, 18 insertions(+), 89 deletions(-)
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 30, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
After upgrading from
9.0.4
to9.0.5
,dynamic(() => import())
are now all merged into commons.js, and no chunks are exported. Before it would create a new chunk for each.It only happens when building for prodution with
target: serverless
. Running in development, the chunks are still generated correctlyExample
I've created a simple Codesandbox that just adds a single
import()
. It correctly chunks and loads the chunk on9.0.4
.See the Network Requests.
Expected behavior
When using the dynamic imports, they should be extracted into chunks by Webpack.
The text was updated successfully, but these errors were encountered: