-
Notifications
You must be signed in to change notification settings - Fork 35
netlify dev supports import() but building on Netlify doesn't #1025
Comments
Confusingly, in development, when trying to
Which leads users into this situation. |
I've found a workaround:
Depending on which dependencies are getting bundled, CommonJS may no longer be an option for some users (like in my case). Perhaps esbuild should be the default for new projects? |
Hi @mjswensen! We're in the processing of rolling out a change that will address this issue, without you having to do any of the workarounds you described. The change is going to be gradually rolled out over the next few days, but if you want I can enrol you in that group right now. You'd just need to send me your Netlify site ID (Go to Site settings > General > Site details > Site information, and copy the value for API ID). You can send it to [email protected] if you don't want to share it in public. Thanks! |
Hi @eduardoboucas , sounds great, I'll send that over now. Thanks! |
Possibly related #1036 |
Describe the bug
In development, the following code works as expected:
But when deploying to production,
my-package
doesn't get bundled, resulting in 500 errors when the function tries to run (Cannot find package 'my-package' imported from /var/task/my-function.js
)To Reproduce
Steps to reproduce the behavior:
netlify dev
Expected behavior
Either Netlify's production function bundling should support this case, or
netlify dev
should not. The behavior should match between the two.The text was updated successfully, but these errors were encountered: