Skip to content

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

@jcalfee

Description

@jcalfee

Environment

node v16.17.1

└─┬ @nuxt/bridge@npm:@nuxt/bridge-edge@3.0.0-27998567.a12a710
  └── nuxi@3.3.2

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions