You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: (intermediate value).require is not a function / import.meta is not supported #2963
changed the title [-]🐛 BUG: (intermediate value).require is not a function / import.meta is not supported[/-][+]🐛 Feature request: (intermediate value).require is not a function / import.meta is not supported[/+]on Oct 22, 2024
Just wanted to share my experience with this coming out of conversations in this issue, and so hoping / looking forward to at least get support for import.meta.url 🤞
changed the title [-]🐛 Feature request: (intermediate value).require is not a function / import.meta is not supported[/-][+]Feature request: (intermediate value).require is not a function / import.meta is not supported[/+]on Jan 11, 2025
Curious if there were any updates on this or sentiment from Cloudflare on supporting import.meta.url? I have now confirmed that in Netlify, Vercel, and AWS Lamba (using both raw upload, SST, and Architect) all have no issues with usage of import.meta.url in deployed function code, so would be great if Cloudflare could support this useful and long-standing web standard as well. 🙏
I acknowledge Netlify and Vercel are derivatives of AWS, and they are all just running NodeJS under the hood, but I wanted to list them all individually mainly in terms of confirming that I wasn't just assuming, and incorrectly attributing support where it may not actually be there. For example, of couple of these providers / tools required opting-out of any pre / post processing they were doing, because in both cases I encountered this with; Netlify and SST, they were pre-bundling all function code with esbuild on their ends, which has had mixed support for import.meta.url and so the best results I found were where I just leveraged their systems for just putting the code in the right place for them to do their uploads / orchestration and nothing else.
So in that regard, in terms of being able to confidently recommend support to users that "yes, this will work" I just wanted to do my due diligence, and would love to include Cloudflare in that group! (and would personally love to start using Cloudflare more myself 😊 )
Re: import.meta.url — if you enable new_module_registry and experimental compatibility flags to your Worker — you'll see this implemented. Can't yet deploy to Cloudflare when using the new_module_registry compatibility flag, but we're working on that.
Very very very soon. It was a lower priority for a while but we've been doing some final acceptance testing on the impl and should be flipping the switch in the next week or two
For anyone following along, it looks like import.meta.* (and more!) is now supported, and can confirm that import.meta.url is working in my simple PoC 🎉
Thank you!
@jasnell
Just a heads up, but for this link in the blog post
Activity
jasnell commentedon Oct 22, 2024
Relabeling this as a feature request. We do not currently implement anything on
import.meta.[-]🐛 BUG: (intermediate value).require is not a function / import.meta is not supported[/-][+]🐛 Feature request: (intermediate value).require is not a function / import.meta is not supported[/+]thescientist13 commentedon Dec 2, 2024
Just wanted to share my experience with this coming out of conversations in this issue, and so hoping / looking forward to at least get support for
import.meta.url🤞[-]🐛 Feature request: (intermediate value).require is not a function / import.meta is not supported[/-][+]Feature request: (intermediate value).require is not a function / import.meta is not supported[/+]thescientist13 commentedon Feb 21, 2025
Curious if there were any updates on this or sentiment from Cloudflare on supporting
import.meta.url? I have now confirmed that in Netlify, Vercel, and AWS Lamba (using both raw upload, SST, and Architect) all have no issues with usage ofimport.meta.urlin deployed function code, so would be great if Cloudflare could support this useful and long-standing web standard as well. 🙏I acknowledge Netlify and Vercel are derivatives of AWS, and they are all just running NodeJS under the hood, but I wanted to list them all individually mainly in terms of confirming that I wasn't just assuming, and incorrectly attributing support where it may not actually be there. For example, of couple of these providers / tools required opting-out of any pre / post processing they were doing, because in both cases I encountered this with; Netlify and SST, they were pre-bundling all function code with esbuild on their ends, which has had mixed support for
import.meta.urland so the best results I found were where I just leveraged their systems for just putting the code in the right place for them to do their uploads / orchestration and nothing else.So in that regard, in terms of being able to confidently recommend support to users that "yes, this will work" I just wanted to do my due diligence, and would love to include Cloudflare in that group! (and would personally love to start using Cloudflare more myself 😊 )
Thanks in advance! 🧡
jasnell commentedon Feb 21, 2025
Import.meta.url will be coming this year. Don't have a more specific target yet
thescientist13 commentedon Feb 21, 2025
Great, thank you for the update!
astanciu commentedon Jul 11, 2025
Any news on this?
irvinebroque commentedon Oct 26, 2025
Re:
import.meta.url— if you enablenew_module_registryandexperimentalcompatibility flags to your Worker — you'll see this implemented. Can't yet deploy to Cloudflare when using thenew_module_registrycompatibility flag, but we're working on that.Re:
import.meta.require— right now that is Bun-specific, and called out in Bun docs as unstable, see: https://bun.com/reference/globals/ImportMeta/requirerefs discussion in nodejs/node#55730
thescientist13 commentedon Oct 28, 2025
Thanks for the update @irvinebroque , looking forward to when this would be testable on Cloudflare 👍
Add new compatibility flags to wrangler.toml
thescientist13 commentedon Jan 17, 2026
Just checking in on this (
import.meta.url), any hope for it in 2026? 🥺fabian-hiller commentedon May 20, 2026
Would be great if
import.meta.globwould be supportedthescientist13 commentedon Aug 4, 2026
@jasnell
Do you know if there are any updates here, in particular on
import.meta.url? Thanks! 🙏jasnell commentedon Aug 4, 2026
Very very very soon. It was a lower priority for a while but we've been doing some final acceptance testing on the impl and should be flipping the switch in the next week or two
thescientist13 commentedon Aug 4, 2026
Awesome and thank you, looking forward to it! 🙌
thescientist13 commentedon Oct 3, 2026
For anyone following along, it looks like
import.meta.*(and more!) is now supported, and can confirm thatimport.meta.urlis working in my simple PoC 🎉Thank you!
@jasnell
Just a heads up, but for this link in the blog post
I get a 404 for it

https://developers.cloudflare.com/workers/configuration/compatibility-flags/new-module-registry
thescientist13 commentedon Oct 3, 2026
Hmm, getting some mixed results here, opened a dedicated issue around the compatibility flag usage - #7606