-
Notifications
You must be signed in to change notification settings - Fork 87
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
fix: copy vendor
over for local dev
#2341
Conversation
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for netlify-plugin-nextjs-demo-all-flags ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for nextjs-plugin-custom-routes-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
One weird thing is that when I go to I can't imagine how this would relate to my changes, so i'll assume this also exists on |
|
||
const newMap = { | ||
scopes: { | ||
"../": importMap.imports, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're moving the imports
field generated by Deno into the ../
scope, so it only applies to our Next code and not to other, Netlify-managed code like the bootstrap layer.
Once we have the import map in place, we should be able to simplify the - ../vendor/esm.sh/v91/[email protected]/deno/dist/server/web/spec-extension/request.js
+ https://esm.sh/v91/[email protected]/deno/dist/server/web/spec-extension/request.js That'll be a small QoL improvement, since it'll make it easier to update versions of the imported files. Gonna do this in a follow-up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the swift fix @Skn0tt!
Closes https://linear.app/netlify/issue/FRA-53/netlify-dev-fails-to-run-middleware.
In #2302, we started vendoring Deno dependencies, but we forgot about copying them over for local dev. This PR fixes that.
The main change is a one-liner, but there was a problem within the way
esm.sh
bundles these two dependencies, and the way we import them via../vendor
:https://github.com/netlify/next-runtime/blob/5d71bfbba214e88cf59ed335a786806c947a2109/packages/runtime/src/templates/edge/next-dev.js#L1-L2
This was fixed by registering the
import_map.json
created by Deno for local dev. There was a bug in how that works though, that was only fixed in a recent release of the CLI. This means customers will need to update to that to get local dev working properly.I've tested this locally with
demos/middleware
, and it's working well!