next.js
next.js copied to clipboard
cssLoader.issuer field removal is causing build processes depending on it to fail
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 Binaries: Node: 16.18.0 npm: 8.19.2 Yarn: 3.1.1 pnpm: N/A Relevant packages: next: 13.0.1 eslint-config-next: 13.0.1 react: 18.2.0 react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Nx
Describe the Bug
Upgrading from [email protected]
to [email protected]
will cause the following packages that rely on NextJs to fail:
-
next-transpile-modules
- Nx plugin for NextJs
The reason being that these two dependencies (and probably others) rely on the cssLoader.issuer
field that has been removed in this PR: https://github.com/vercel/next.js/pull/42106/files
Both next-transpile-modules
and Nx plugin for NextJs seem to rely on this field to perform the bundling.
Expected Behavior
The build process should work (as per [email protected]
). However, the build processes fails with [email protected]
due to the removal of the issuer
field in the exposed CSS loader.
Link to reproduction
https://github.com/terrymun/nextjs-cssloader-issuer
To Reproduce
- Checkout the repository at https://github.com/terrymun/nextjs-cssloader-issuer
- Notice that
next-transpile-modules
has been installed and is used to transpilelodash
as an example - Run
npm run dev
. The error message will appearTypeError: Cannot read properties of undefined (reading 'and')
, as theissuer
field has been removed as of[email protected]
- Downgrade to
[email protected]
by runningnpm install -D [email protected]
- Rerun
npm run dev
, and notice the server starts normally.
I think this should be solved at next-transpile-modules
level tbh. It's a little bit hard for the Next.js maintainers to test every plugin out there.
I should have a working copy soon.
@martpie That's lovely :)
I am wondering though, if this should've been a breaking change, as this only only affects your package but also breaks Nx as well, which many people are also using.
I don't know Nx at all tbh. The good news is the Next.js team is actively working on implementing next-transpile-modules
natively. So we should hopefully not have to care about this kind of regressions in the future :]
https://github.com/vercel/next.js/discussions/42136
@martpie @terrymun just to confirm I have now got this issue after upgrading from 13.0.0 to 13.0.1 today. I am using next-transpile-modules
which is required to use amcharts4
.
Fixed in [email protected]
, cheers!
@martpie confirmed working on my side after upgrading to [email protected]
. Many thanks for super fast turnaround :)