Skip to content
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

Feature request: (intermediate value).require is not a function / import.meta is not supported #2963

Open
schettn opened this issue Nov 23, 2023 · 2 comments
Labels
feature request Request for Workers team to add a feature nodejs compat web platform

Comments

@schettn
Copy link

schettn commented Nov 23, 2023

Which Cloudflare product(s) does this pertain to?

Workers Runtime

What version(s) of the tool(s) are you using?

3.17.1

What version of Node are you using?

No response

What operating system are you using?

Mac

Describe the Bug

[ERROR] service core:user:my-app: Uncaught TypeError: (intermediate value).require is not a function

at index.js:43523:22 in __require2

The problem is that my code / the generated bundle uses:

var __require = id => {
  return import.meta.require(id)
}

And workerd provides an empty object for import.meta, thus import.meta.require is undefined and not a function.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@schettn schettn added the bug Something isn't working label Nov 23, 2023
@penalosa penalosa transferred this issue from cloudflare/workers-sdk Oct 21, 2024
@jasnell jasnell added bug Something isn't working feature request Request for Workers team to add a feature and removed bug Something isn't working labels Oct 22, 2024
@jasnell
Copy link
Member

jasnell commented Oct 22, 2024

Relabeling this as a feature request. We do not currently implement anything on import.meta.

@jasnell jasnell 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 Oct 22, 2024
@thescientist13
Copy link

thescientist13 commented 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 🤞

@jasnell jasnell removed the bug Something isn't working label Jan 11, 2025
@jasnell jasnell 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 Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for Workers team to add a feature nodejs compat web platform
Projects
Status: Other
Development

No branches or pull requests

3 participants