next.js: Build Crash on Windows (`TypeError`) for `_isAppDir`

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Binaries:
  Node: 18.13.0
  npm: 9.6.7
  Yarn: 1.22.19
  pnpm: 8.6.0
Relevant packages:
  next: 13.4.5
  eslint-config-next: 13.4.5
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3

Which area(s) of Next.js are affected? (leave empty if unsure)

Operating System (Windows, MacOS, Linux)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/nodejs/nodejs.org/pull/5426

To Reproduce

The Issue actually happens within GitHub Actions on a Windows Runner. And seems to be fine on Linux and macOS builds. It seems to be related to “app directory” even thought we do not use the “app directory feature”

Describe the Bug

build: TypeError: Cannot read properties of undefined (reading '_isAppDir')
build:     at D:\a\nodejs.org\nodejs.org\node_modules\next\dist\export\index.js:420:39
build:     at Array.filter (<anonymous>)
build:     at D:\a\nodejs.org\nodejs.org\node_modules\next\dist\export\index.js:419:43
build:     at async Span.traceAsyncFn (D:\a\nodejs.org\nodejs.org\node_modules\next\dist\trace\trace.js:103:20)
build:     at async D:\a\nodejs.org\nodejs.org\node_modules\next\dist\build\index.js:1489:21
build:     at async Span.traceAsyncFn (D:\a\nodejs.org\nodejs.org\node_modules\next\dist\trace\trace.js:103:20)
build:     at async D:\a\nodejs.org\nodejs.org\node_modules\next\dist\build\index.js:1345:17
build:     at async Span.traceAsyncFn (D:\a\nodejs.org\nodejs.org\node_modules\next\dist\trace\trace.js:103:20)
build:     at async build (D:\a\nodejs.org\nodejs.org\node_modules\next\dist\build\index.js:145:[29](https://github.com/nodejs/nodejs.org/actions/runs/5253121230/jobs/9490043267?pr=5426#step:7:30))
build: ERROR: command finished with error: command (D:\a\nodejs.org\nodejs.org) npm run build exited (1)
command (D:\a\nodejs.org\nodejs.org) npm run build exited (1)

GitHub Action: https://github.com/nodejs/nodejs.org/actions/runs/5253121230/jobs/9490043267?pr=5426

Expected Behavior

The build should succeed as in the other systems (Linux, macOS).

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1504

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@styfle note that you’re using the wrong command. It’s not npm run build but npm run deploy

@bmuenzenmeyer can you format your error output on a “markdown code block”?