nextra: Watchpack Error (initial scan): Error: ENOTDIR: not a directory in v3
Describe the bug
Tried to use nextra 3.0.1 and got the following issue (reproduced in codesandbox).
To Reproduce
- Go to codesandbox.io
- Click on the
Start Dev Serverterminal - See error and broken UI
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/project/sandbox/node_modules/next/dist/pages/_app.js'
⚠ ./node_modules/@typescript/vfs/dist/vfs.esm.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@typescript/vfs/dist/vfs.esm.js
./node_modules/twoslash/dist/index.mjs
./node_modules/@shikijs/twoslash/dist/index.mjs
./node_modules/nextra/dist/server/compile.js
./node_modules/nextra/dist/client/components/playground.js
./node_modules/nextra/dist/client/components/index.js
./node_modules/nextra-theme-docs/dist/index.js
Expected behavior
No error in terminal and a working nextra site.
Additional context
Setup from the Getting Started tutorial with the following dependencies versions
{
"next": "14.2.13",
"nextra": "3.0.1",
"nextra-theme-docs": "3.0.1",
"react": "18.3.1",
"react-dom": "18.3.1"
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 15
- Comments: 31 (4 by maintainers)
Commits related to this issue
- fix: bump nextra for https://github.com/shuding/nextra/issues/3322 fix — committed to mnahkies/openapi-code-generator by mnahkies 2 years ago
@dimaMachina can confirm - that fixed it for me, thanks for such a quick turnaround!
@mnahkies thanks for the contribution, fix is coming!
@mnahkies can’t reproduce locally
same result when I am on
renovate/allbranch@danielkleinstein I still have the same issue with 3.0.7, my fix for now is to use the
patchcommand of pnpm/yarn/bun to comment the twoslash import and usage fromnextra/dist/server/compile.js:Comment the twoslash import and usage from
dist/server/compile.jsCommit the patch
Not ideal but I don’t need twoslash and it cannot be disabled right now.
For now I’m working with this workaround in
next.config.mjs:But this isn’t ideal.
I found how to fix warnings from
@typescript/vfswithout waiting for upstream fix 🎉https://github.com/shuding/nextra/pull/3330
try
3.0.2where the warningWatchpack Error (initial scan): Error: ENOTDIR: not a directory, scandiris gone and styles seems correctly appliedSame problem when I followed the steps here: https://nextra.site/docs/docs-theme/start