-
Notifications
You must be signed in to change notification settings - Fork 296
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
Webpack build error on Next.js 13.2 #1013
Comments
I can also confirm that there is a problem with the latest versions of Next.js. I also tested canary releases after v13.1.6 and the problem occurs with v13.1.7-canary.8 and up.. v13.1.7-canary.7 still works fine. Error message in my case: "Error: You forgot to add 'mini-css-extract-plugin' plugin (i.e. { plugins: [new MiniCssExtractPlugin()] })" |
Seems likely to be related to this: vercel/next.js#46374 |
Same issue here. Is there a fix? |
It looks the issue is related to here |
Looking into this further it seems that this problem is due to the import { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css';
import { getGlobalCssLoader } from 'next/dist/build/webpack/config/blocks/css/loaders'; |
Since vanilla-extract-css uses Next.js internal APIs and we recently upgraded it, it's no longer working. I opened a PR in Next.js to refactor that API to be non-breaking but in the meantime you'll have to pass: vanilla-extract/packages/next-plugin/src/index.js Lines 40 to 47 in c59aee2
|
Hi @shuding, thanks for helping us out! We discovered the I applied your suggestion in a local patch and am still getting the same error |
I'll take a look at #929! This issue requires a change on the Next.js side too, which was just released as canary so you might want to try |
This appears to be resolved with nextjs version 13.2.3 |
I have verified that this particular issue is resolved in next 13.2.3. 👍 I have also verified that the patches in #929 are still required to make VE work. Let's continue the conversation there. |
Describe the bug
Error with internal webpack configuration at build time when using
@vanilla-extract/next-plugin
in Next.js v13.2 delivered yesterday.Reproduction
https://github.com/re-taro-dev/card.re-taro.dev
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: