Closed NOBLES5E closed 1 month ago
Hi, thanks for filing this 👋. I just pushed @number-flow/react@0.2.4
with an attempted fix. Please comment if you'e still experiencing issues!
@NOBLES5E do you have a link to an issue on Cloudflare/esm-env/Vite for this by chance? I couldn't find anything and it'd be nice to know if it gets resolved 👋
Yes, it is resolved. We use it in an internal project, so no issues can be found on GitHub.
Thank you for the quick fix!
Oh, great to hear! I was actually wondering if you had a link to an upstream issue for esm-env on Cloudflare Pages? It sounds like a bug on Cloudflare Pages and I'd like to switch back to esm-env at some point 😄
I just reverted to using esm-env
because it's better for tree-shaking, so in case you upgrade and are still experiencing issues you should be able to add this to your package.json:
"overrides": {
"esm-env": "npm:esm-env-runtime@^0.1.0"
}
Please let me know if you're still experiencing issues 👋
@barvian The issue is occurring again after upgrading. I'm getting the following error:
06:47:02 [ERROR] ReferenceError: HTMLElement is not defined
at chunks/index_BVeMng_S.mjs:2:18862
I tried adding the suggested override to package.json:
"overrides": {
"esm-env": "npm:esm-env-runtime@^0.1.0"
}
However, this doesn't resolve the HTMLElement reference error.
@NOBLES5E Hi, could you try esm-env-runtime@^0.1.1 now?
Everything is working properly now. Really appreciate the quick responses and fixes.
There's currently an issue with
esm-env
package's exports resolution when running in Cloudflare Pages environment. The problem stems from Cloudflare Pages being treated as a WebWorker environment, which Vite considers as a browser environment. This causes server-side code to incorrectly use browser exports.