Skip to content
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

Cannot deploy if any route uses the edge runtime #104

Open
andreslemusm opened this issue Apr 18, 2024 · 9 comments
Open

Cannot deploy if any route uses the edge runtime #104

andreslemusm opened this issue Apr 18, 2024 · 9 comments

Comments

@andreslemusm
Copy link

andreslemusm commented Apr 18, 2024

Hi!

I'm started getting the following error today:

Error: The Edge Function "xxx" is referencing unsupported modules: - use-sidecar: detect-node-es

I tried:

  • Redeploy old deploy with status ready, it doesn't work.
  • Search for any dependency in my app using that module, had no luck finding one.
  • Deploy with the "nodejs" runtime the whole app, it works, but I want some public routes to be at the edge.

Any hint on how to find to root cause of this issue?

Thanks for the help!

@TooTallNate
Copy link
Member

We did roll some changes to the module resolution logic for edge functions today (to address #94). Let me know your Vercel team name and I can turn the flag for that off for you. But also, it would be helpful if you could share a reproduction so that I can take a closer look.

@andreslemusm
Copy link
Author

andreslemusm commented Apr 18, 2024

We did roll some changes to the module resolution logic for edge functions today (to address #94). Let me know your Vercel team name and I can turn the flag for that off for you. But also, it would be helpful if you could share a reproduction so that I can take a closer look.

@TooTallNate My team name is: "sublime" (is ok to share it or should I remove this comment?)

Thank you for the help! I'll try to create a reproduction

@TooTallNate
Copy link
Member

Ok, I disabled the flag for your team for now. Sharing the team name publicly is fine, but feel free to delete if you prefer.

@andreslemusm
Copy link
Author

Ok, I disabled the flag for your team for now. Sharing the team name publicly is fine, but feel free to delete if you prefer.

Awesome, deployments are working fine again 🥳

@peterje
Copy link

peterje commented Apr 18, 2024

@TooTallNate My team was also affected by this yesterday. I've created a repro project which uses the latest Remix vercel preset. In my case, the openai packages was failing to resolve modules for the edge runtime.

I was able to resolve this specific issue by manually importing "openai/shims/web" in my edge function. Importing that package has some implications for module resolution. This may be specific to the openai package, but hoping it can point your team to the solution.

This solution seems to work for now, so no action requested on your end. Can you provide more details about the updated module resolution strategy?

@peterje
Copy link

peterje commented Apr 18, 2024

@TooTallNate My team was also affected by this yesterday. I've created a repro project which uses the latest Remix vercel preset. In my case, the openai packages was failing to resolve modules for the edge runtime.

I was able to resolve this specific issue by manually importing "openai/shims/web" in my edge function. Importing that package has some implications for module resolution. This may be specific to the openai package, but hoping it can point your team to the solution.

This solution seems to work for now, so no action requested on your end. Can you provide more details about the updated module resolution strategy?

@TooTallNate Despite a passing build, my proposed solution continues to crash at runtime. Please opt out the team teaching-lab from this feature.

@TooTallNate
Copy link
Member

@peterje The flag has been turned off globally at this point. If you're still having issues, it's unrelated to the change related to this issue.

@peterje
Copy link

peterje commented Apr 18, 2024

@peterje The flag has been turned off globally at this point. If you're still having issues, it's unrelated to the change related to this issue.

Indeed I was...thanks for the info.

@dvargas92495
Copy link

@TooTallNate was this flag turned on at any point? I have a simple example that uses just the qs package (74M+ downloads) and I'm still seeing:
Screenshot 2024-06-13 at 4 34 56 PM

npm ls of how object-inspect is eventually resolved from qs:
Screenshot 2024-06-13 at 4 35 42 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants