-
Notifications
You must be signed in to change notification settings - Fork 511
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
Issues with bundling date-fns
#1889
Comments
Thanks for making issue with reproduction. It seems a bug with rollup cjs plugin generated code. Wrangler:
Deno deploy:
Re I made (yet another) esm redist "resolutions": {
"date-fns": "npm:date-fns-es"
} |
date-fns
isn't inlined correctly when producing single outputdate-fns
The same error happens on Vercel Edge Functions (it is working on normal Vercel Functions tho):
And on Cloudflare Pages I get:
Minimal reproduction repo (Nuxt 3): https://github.com/MickL/nuxt-datefns I am not exactly sure if the issue is on Nitro side or date-fns? The ESM support issue at date-fns is open for more than 3 years with an open PR for more than one year. |
@MickL Thanks for confirming. Yes this issue with bundling date-fns via rollup to an esm bundle applies for every bundled runtime. If we cannot find an easy solution i think we shall start auto patching date-fns to esm version |
|
I can confirm that date-fns |
I think this can be close as completed! date-fns works fine since 3.0 |
Environment
node 20.9
nitro 2.7.2
Reproduction
https://stackblitz.com/edit/github-yysl4x?file=routes/index.ts,nitro.config.ts
You'll need to download locally to run
wrangler
Describe the bug
Some libraries (specifically
date-fns
here) can be inlined incorrectly in cloudflare-pages output (for example) but I suspect any single-file output.Downstream issue: nuxt/nuxt#23963
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: