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

[nuxi build] __dirname is not defined in ES module scope #727

Closed
jcalfee opened this issue Mar 29, 2023 · 2 comments
Closed

[nuxi build] __dirname is not defined in ES module scope #727

jcalfee opened this issue Mar 29, 2023 · 2 comments

Comments

@jcalfee
Copy link

jcalfee commented Mar 29, 2023

Environment

node v16.17.1

└─┬ @nuxt/bridge@npm:@nuxt/[email protected]
  └── [email protected]

Reproduction

Not sure where to go from here. The build reports one error at a time and typically does not point to my own source files so I global search to find the error. This time, the I'm not using __dirname in my code so I don't know where to go to fix it or where to go to gather more information for this issue.

nuxi build

 FATAL  __dirname is not defined in ES module scope                                                                                                                          09:21:08

  at requireServer (.nuxt/prerender/chunks/nitro/nitro-prerenderer.mjs:493:17)
  at newInstance (.nuxt/prerender/chunks/nitro/nitro-prerenderer.mjs:511:18)
  at .nuxt/prerender/chunks/nitro/nitro-prerenderer.mjs:534:30
  at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
  at async Promise.all (index 0)
  at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
  at async prerender (node_modules/nitropack/dist/shared/nitro.43f4f2d5.mjs:4140:26)
  at async node_modules/@nuxt/bridge/dist/shared/bridge-edge.74947122.mjs:403:7
  at async Nuxt.callHook (node_modules/hable/dist/hable.js:1:959)
  at async Builder.build (node_modules/@nuxt/builder/dist/builder.js:251:5)
  at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:59:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:49:20)

Describe the bug

compiler error

Additional context

No response

Logs

build time
@danielroe danielroe transferred this issue from nuxt/nuxt Mar 29, 2023
@danielroe
Copy link
Member

Would you provide a reproduction? 🙏

@jcalfee
Copy link
Author

jcalfee commented Jun 4, 2023

Sorry, moved on. I'll do a reproduction if this comes up again.

@jcalfee jcalfee closed this as completed Jun 4, 2023
@danielroe danielroe mentioned this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants