-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Build time error: Can't resolve @swc/helpers/... #48593
Comments
I am pretty sure this issue was introduced by version v13.3.1-canary.12. |
You are using probably a monorepo if is the case I have posted one workaround in the meantime |
Thank you for your reply. Yes, our project uses a monorepo package called @adobe/react-spectrum, which is an umbrella package that is used in all the React Spectrum component packages. This is a fairly common pattern for a UI component library. However, it is important to note that Next.js supported this usage until v13.3.1-canary.12. Therefore, we hope that Next.js will continue to support this usage in future versions as well. |
I found a potential related swc-project/swc#5009 in swc-project/swc repo. |
Tried v13.3.1-canary.17, problem still exists. |
Maybe this could be given extra attention? This literally bombs when trying to follow the Getting Started guide. Thanks! |
I'm getting the same errors using Turborepo. My additional information mimic for the original reports but I also hopped over to a machine to confirm the results and those details are below. So I've received the same result on both MacOS and Windows. I, too am starting from 'getting started' so this Next app is brand new, but been a non-starter as this presents itself right out the gate. Thanks and let me know if I can provide any better detail. I can post my macOS details as needed but they mimic the og post as mentioned earlier.
|
When using 13.2.x everything works fine. This is 4 days open and literally makes the framework unusable, will anyone fix this? |
Getting the same with |
For people looking for a temporary fix you can use this workaround this issue is not only attached to @swc/helpers this issue es related to all packages that has different versions installed in monorepo. This is failing only in this because the helpers change from the v0.4 to the 0.5 the structure so when resolving to the last version that src folder does not exist also if you use turbopack the issue does not exist. |
@joacub, thanks for sharing your findings and the temporary workaround in #48577. I appreciate your insight on the issue and the connection with monorepos.
It's worth noting that if the issue doesn't exist when using turbopack, it could be an alternative solution for some users. However, it would be helpful if the @swc/helpers maintainers could clarify whether the changes between v0.4 and v0.5 should be considered breaking and if there is a recommended migration path for dependent packages. |
In monorepos is valid to have different versions not compatible each other, Webpack or nextjs is just not resolving correctly to the package.json node_modules relative to that package, the package exist and it is installed, webpack is just not doing right or next i don’t know who , that’s why the plug-in in Webpack resolved correctly which is a pretty easy solution and I’m really suprised that Webpack is not resolving correctly as that’s how webpack resolved usually. but I don’t know …. |
I think |
@jianliao A change from |
This error is geting fixed by using nextjs version 13.2.4 |
Just like I said, if you use 13.2.x it works. Just not a great of a "fix" ah ah just use a version from couple months ago |
I had such error for P.S. probably you need to set exact version, if you already have |
yeah, I also noticed that some early version work if you don't use the |
Good tip actually, I was under the assumption I had to go back to 12.2.x because I use |
I tried almost all solutions but the same issue! did anyone resolve it?
|
Thanks! Resolved ✅ |
I am also experiencing similar issue with
Installing Next.js 13.3.0 makes the issue disappear. |
next.js/packages/next/src/build/webpack-config.ts Lines 1070 to 1072 in 2f6ff0d
This is the cause. There's no logic for respecting the semver of @magic-akari How do you think about exposing Technically, this is not a problem of SWC, but I'm not sure if specifying semver in |
I still have this issue with Jest and |
@salamaashoush You may have try the recently released Next.js of version 13.3.2. |
v13.3.2 officially released to solve this issue. |
yeah maybe I should report it on the react-aria or swc repo since I am not using nextjs and I have the same error but with jest, any help @kdy1? |
Facing this issue on |
When trying to deploy Docker on Ubuntu 22.04 I get the following: Next version:
But on my Macbook M1 using Docker the errors don't happen |
I still have this issue with Jest when using Next 13.4.4. The latest Next version that works for me is 13.3.0. |
How to fix this bug in nextjs@12.x ? |
I have the issue on 13.3.0 oddly. |
I'm also wondering if somebody knows how to fix this with Next 12.x, using patch-package or whatever. |
I was about to ask the same thing |
Maybe someone from the @vercel team can patch next@12 to fix it issue |
for next@12, a quick temporary fix is to pin the version in
|
Same here, except for tsconfig paths. Help would be appreaciated: Running build insinde alpine-18 container will yield: Failed to compile. ./src/app/[locale]/logout/page.tsx |
Is there a repro, if it still occurs? |
There is a number of off-topic questions in this issue thread. If anyone has the problem with |
@kdy1 here's a repro: https://github.com/devongovett/next-swc-helpers-repro. It specifically occurs in Next 12 I think because Next's webpack config overrides the resolution to point to |
It's now fixed 😄 You must update "resolutions": {
"next/@swc/helpers": "0.4.36"
} Thank you @devongovett and @magic-akari |
npm overrides: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides "overrides": {
"next": {
"@swc/helpers": "0.4.36"
}
} yarn resolutions: https://yarnpkg.com/configuration/manifest#resolutions "resolutions": {
"next/@swc/helpers": "0.4.36"
}, pnpm.overrides https://pnpm.io/package_json#pnpmoverrides "pnpm": {
"overrides": {
"@swc/helpers@~0.4": "0.4.36"
}
} |
Thanks so much @kdy1 @magic-akari! |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/jianliao/nextjs-rsp-bug
To Reproduce
The issue is exactly same as #38192.
Describe the Bug
After upgrade to
next@13.3.1-canary.16
, next build will fail with below error messages:Expected Behavior
Build success.
Which browser are you using? (if relevant)
Chrome 113.0.5672.35
How are you deploying your application? (if relevant)
next build
The text was updated successfully, but these errors were encountered: