netlify / edge-bundler

Intelligently prepare Netlify Edge Functions for deployment
https://www.npmjs.com/package/@netlify/edge-bundler
MIT License
12 stars 8 forks source link

DENO_VERSION_RANGE semver constraint is too loose #575

Open willsr opened 9 months ago

willsr commented 9 months ago

The DENO_VERSION_RANGE constant is currently set to '^1.37.0' which would satisfy anything from 1.37.0 - 1.99.x. There is a bug in versions 1.40.x of Deno (See: https://github.com/denoland/deno/issues/22109) which is causing edge functions to fail that rely on certain external modules.

Is it possible to set a fixed Deno version for use in local development? (apart from just manually downloading the desired version into /Users/User/Library/Preferences/netlify - which I can't find any documentation for)

Also is there any way to know the current Deno version running in the Netlify hosted environment?

Skn0tt commented 9 months ago

Hey Will! Looking through the code, I don't see a way of fixing the Deno version, no. If i'm understanding https://github.com/denoland/deno/issues/22109 correctly, this doesn't have a super widespread impact. If Deno intends to publish a fix for that this week, then I don't think we can provide a workaround earlier than that. In the meantime, the workaround you mentioned sounds like an "alright enough" solution. Alternatively, you could go into your node_modules directory and manually edit the DENO_VERSION_RANGE variable.

That's not a beautiful workaround, but if Deno publishes a fix this week, then it should be alright. Let me know if this works for you!

willsr commented 9 months ago

Ok, thanks for responding. Is there a way to to know the current Deno version running in the Netlify hosted environment for edge functions? Or a way to set it manually (similarly to the Node.js version)?

Skn0tt commented 9 months ago

In the hosted environment, Deno Deploy is managing the version updates - it's not possible to change the version there, no.

Skn0tt commented 9 months ago

It looks like Deno has completed the mentioned issue - I guess it'll be fixed in their next Patch release.