Open petyosi opened 1 year ago
Have the similar issue with minification on last canary release
TypeError: Cannot read properties of undefined (reading 'cat')
If turn off minification with webpack everything is fine.
module.exports = (nextConfig) => {
return {
...nextConfig,
webpack(webpackConfig) {
return {
...webpackConfig,
optimization: {
minimize: false
}
};
}
};
};
next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103
Binaries:
Node: 16.18.0
npm: 9.2.0
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 13.4.10-canary.3
eslint-config-next: 13.1.1
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.3
Next.js Config:
output: N/A
More information, this is a bug in SWC - https://github.com/swc-project/swc/issues/7640.
More information, this is a bug in SWC - swc-project/swc#7640.
Thanks, swcMinify: false -- like a workaround
It looks like this is fixed in @swc/core 1.3.68 (the latest release).
Any updates on this? It creates hydration errors in component MDXEditor which I am using for my project. https://github.com/mdx-editor/editor/issues/4
@mblouka, mdxeditor author here, I believe that this is resolved in the latest Next.js release.
we saw an example of this with a library here, using swcMinify:false fixed it but hopefully could get a fix from swc also https://github.com/molstar/molstar/issues/1046
tested with next 14.10
repro https://github.com/cmdcolin/nextjs-molstar-swc-minify-error
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/petyosi/lezer-minification-next
To Reproduce
yarn dev
, openlocalhost:3000
in browser, console should be clearyarn build
, thenyarn start
localhost:3000
in the browser, An error That looks like this should be visible:Describe the Bug
I believe that this is a bug in the minification. Going to the location in the minified source code, I see code that seems to assign something to
0
. The package that causes the culprit is @lezer/markdown, used by codemirror.Expected Behavior
No minification error
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response