-
Notifications
You must be signed in to change notification settings - Fork 133
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
[🐛 Bug]: ERROR Could not resolve "async_hooks" #908
Comments
I am encountering the same (only difference is |
Seeing it on Node.js v20.18.1 also with these versions:
Interestingly, while it is failing in GitHub Actions, it works for me locally on OSX with the same version for all of these dependencies). Maybe if I do an npm install that will change. |
Deleting .vercel caused it to start failing locally. Unfortunately I didn't check the node_modules in there before deleting. The dependency versions in .vercel/builders/package.json afterward are I am not sure, but it seems like I was on @vercel/build-utils 8.4.3 before that - 8.4.3 is what is in my package's own node-modules folder. @vercel/[email protected] and @vercel/[email protected] were published 5 hours ago. https://github.com/vercel/vercel/commits/main/packages/next does NOT seem benign. |
Same issue with |
The workaround we found worked was rolling back {
"devDependencies": {
"vercel": "39.1.1"
},
"overrides": {
"vercel": "$vercel"
}
} You'll also have wipe out any references to |
I also face the issue. |
This seems to fix it for now thanks @sampotts |
Same problem I meet, almost no content has been changed. Yesterday it compiled OK, but today it reported an error.
|
This solution didn't work for me...
|
Add |
adding vercel in devdependencies in package.json worked for me
|
@kaiono-g you might have to: run npm install and delete the .vercel folder. |
If you are using pnpm, try this: pnpm i [email protected] -D Remember to update the lockfile and clear the build cache. |
This fix works for me. I got the same issue when deploying on Cloudflare pages
But why do we need the Vercel package when deploying it to Cloudflare? |
Even after adding "vercel": "39.1.1" to devDependencies the build on cloudflare still fails
Works well in my local build and github actions but for some weird reason during cloudflare build it still uses [email protected] |
I'm using pnpm and fixed the vercel version to 39.1.1. I can also see from CF's build log that it's using 39.1.1, yet it still fails with CF deployment log:
Everything compiles fine locally with edit |
we are using github actions and Cloudflare (yes, two separate projects with different CI/CD) and experiencing same issue - locally proposed solution with fixing |
Same here. Next + Cloudflare This worked
|
I suspect the cause to be this:
Which will use the latest version of For The workarounds using |
@IgorMinar Can we pin the Vercel dependency version to a known number so this doesn't happen every time Vercel cuts a release? |
using yarn and trying to pin the version like this:
but it's just not working. I keep getting this error |
I tried to pin the version to I was able to resolve the build issue by following @chrisp-code's comment and moving |
Don't forget to |
So? Closed it without fixing? Pining the version just temporarily work around. |
It has been fixed in the new release - v1.13.6 Note Please bump your Pages project's compatibility date setting to the most recent one for both Preview and Production environments so that you can use the new version of nodejs_compat. |
Yes, I have tried. It works. Thank you! |
I tried building with the new release v1.13.6 The build works (both locally and in Cloudflare). When i do But in production loading the website page gives an error 500 and i see this in the Cloudflare logs:
|
So FYI even with the fix I started to get the following with NextAuth:
Implementing the vercel version into devDependencies and even with the latest next-on-pages and I am working again at least - but something has definitely broken between Cloudflare and Vercel ... |
thank you |
Thanks so much for the detailed instructions, @james-elicx . Updating the package fixed the build and bumping the compatibility date fixed the prod issue 🤝
|
That worked for me too ^^^ thanks @james-elicx |
Thanks, I think i just had to clear the build cache and now they are working again. |
worked with the new compatibility date |
It worked on the latest 1.13.6 thanks |
Still having this error with 1.13.6 UPD: Fixed by adding this to wrangler.toml:
|
getting this #908 (comment) issue using: compatibility_date = "2024-11-11" with
|
See next-on-pages issue 908 cloudflare/next-on-pages#908 (comment) Available dates can be checked in cloudflare dashboard, also need to set it manually for preview and production environments.
fix lyc8503#34: upstream problem cloudflare/next-on-pages#908
fix lyc8503#34: upstream problem cloudflare/next-on-pages#908
Final Solution:
and
|
thank you so much bro it works for me, thanks again |
Damn I spent a whole day trying to make it work and this did the trick. Thank you so much! |
I hit this issue as well, my fix did not require changing package versions for anything from npm In the end, all I had to do was update the |
this works for me, i use {
"name": "...",
"compatibility_date": "2024-09-23", // update the date
"compatibility_flags": ["nodejs_compat"],
"pages_build_output_dir": ".vercel/output/static"
} |
next-on-pages environment related information
System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
CPU: (10) arm64 Apple M1 Max
Memory: 32 GB
Shell: /bin/zsh
Package Manager Used: npm (10.2.4)
Relevant Packages:
@cloudflare/next-on-pages: 1.13.5
vercel: N/A
next: 14.2.18
Description
It just started happening out of the blue. Both when i try to build locally or when I git push and Cloudflare does the build for production.
Even on Cloudflare pages if i try to re-deploy an old commit version that had previously deployed successfully, it also fails.
Not sure exactly what the issue is...
This is what i see in the terminal logs, and i see the error comes after the next build has completed:
Reproduction
No response
Pages Deployment Method
Pages CI (GitHub/GitLab integration)
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: