You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System: Linux (Ubuntu)
Node Version: v22.14.0
Nuxt Version: 3.16.1
Nitro Version: 2.11.7
Package Manager: npm@10.9.2 (also tested with Bun@1.2.7)
Preset: cloudflare-pages
Compatibility Date: 2025-03-12 (also tested with 2025-03-20)
Reproduction
Nuxt 3.16.1 with Nitro 2.11.7
ℹ Building for Nitro preset: cloudflare-pages
✔ Generated public dist
[nitro] ℹ Building Nuxt Nitro server (preset: cloudflare-pages, compatibility date: 2025-03-12)
[nitro] ERROR Error: ENOTDIR: not a directory, stat '/home/hermes/Projetos-linux/cidadeMobile/node_modules/nitropack/node_modules/unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
undefined
[ERROR] ENOTDIR: not a directory, stat '.../unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
error: script "build" exited with code 1
Describe the bug
When building a Nuxt 3.16.1 project with Nitro 2.11.7 using the cloudflare-pages preset, the build fails with the following error:
[nitro] ERROR Error: ENOTDIR: not a directory, stat '.../node_modules/nitropack/node_modules/unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
The error occurs during the "Building Nuxt Nitro server" step, indicating that unenv (via nitropack) is attempting to treat webidl2js-wrapper as a directory when it should be a file, or the file is missing/corrupted in the unenv@1.10.0 structure. This happens consistently both locally (Ubuntu, Node 22.14.0, Bun 1.2.7 or npm 10.9.2) and on Cloudflare Pages deployment. The issue persists despite forcing unenv@1.10.0 in resolutions and excluding whatwg-url/webidl2js-wrapper in nitro.externals.inline.
I suspect this is a bug in how unenv@1.10.0 structures or resolves whatwg-url.mjs/webidl2js-wrapper for the cloudflare-pages preset. I’m happy to submit a PR if guided on where to start—thanks!
Below is the output from running `bun run build` on my project with Nuxt 3.16.1, Nitro 2.11.7, and `unenv@1.10.0` forced via `resolutions`. The error occurs during the Nitro server build step with the `cloudflare-pages` preset:
bun update v1.2.7 (5c0fa6dc)
$ nuxt prepare && bun run build:icons
✔ Types generated in .nuxt nuxi 8:33:07 PM
$ tsx plugins/iconify/build-icons.ts
Saved CSS to /home/hermes/Projetos-linux/cidadeMobile/plugins/iconify/icons.css!
↑ eslint-import-resolver-typescript 4.2.7 → 4.3.1
+ unenv@1.10.0
ℹ Prerendered 17 routes in 15.808 seconds nitro 8:35:50 PM
✔ Generated public dist nitro 8:35:50 PM
[nitro 8:35:50 PM] ℹ Building Nuxt Nitro server (preset: cloudflare-pages, compatibility date: 2025-03-12)
node_modules/openai/core.mjs (1:30): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/openai/core.mjs (1:38): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/openai/core.mjs (7:30): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/openai/core.mjs (7:38): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
[nitro 8:35:52 PM] ERROR Error: ENOTDIR: not a directory, stat '/home/hermes/Projetos-linux/cidadeMobile/node_modules/nitropack/node_modules/unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
undefined
[8:35:52 PM] ERROR ENOTDIR: not a directory, stat '/home/hermes/Projetos-linux/cidadeMobile/node_modules/nitropack/node_modules/unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
[8:35:52 PM] ERROR ENOTDIR: not a directory, stat '/home/hermes/Projetos-linux/cidadeMobile/node_modules/nitropack/node_modules/unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
error: script "build" exited with code 1
This log shows the build failing at the Nitro step, with the `ENOTDIR` error pointing to `unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper`. The same error occurs with npm (`npm run build`) and on Cloudflare Pages deployment.
The text was updated successfully, but these errors were encountered:
pi0
changed the title
ENOTDIR: not a directory with whatwg-url.mjs/webidl2js-wrapper in Cloudflare Pages preset (Nuxt 3.16.1, Nitro 2.11.7)
ENOTDIR: not a directory with whatwg-url.mjs/webidl2js-wrapperMar 31, 2025
Environment
Environment
Reproduction
Nuxt 3.16.1 with Nitro 2.11.7
ℹ Building for Nitro preset: cloudflare-pages
✔ Generated public dist
[nitro] ℹ Building Nuxt Nitro server (preset: cloudflare-pages, compatibility date: 2025-03-12)
[nitro] ERROR Error: ENOTDIR: not a directory, stat '/home/hermes/Projetos-linux/cidadeMobile/node_modules/nitropack/node_modules/unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
undefined
[ERROR] ENOTDIR: not a directory, stat '.../unenv/dist/runtime/npm/whatwg-url.mjs/webidl2js-wrapper'
error: script "build" exited with code 1
Describe the bug
When building a Nuxt 3.16.1 project with Nitro 2.11.7 using the
cloudflare-pages
preset, the build fails with the following error:The error occurs during the "Building Nuxt Nitro server" step, indicating that
unenv
(vianitropack
) is attempting to treatwebidl2js-wrapper
as a directory when it should be a file, or the file is missing/corrupted in theunenv@1.10.0
structure. This happens consistently both locally (Ubuntu, Node 22.14.0, Bun 1.2.7 or npm 10.9.2) and on Cloudflare Pages deployment. The issue persists despite forcingunenv@1.10.0
inresolutions
and excludingwhatwg-url
/webidl2js-wrapper
innitro.externals.inline
.I suspect this is a bug in how
unenv@1.10.0
structures or resolveswhatwg-url.mjs/webidl2js-wrapper
for thecloudflare-pages
preset. I’m happy to submit a PR if guided on where to start—thanks!Additional context
Logs
The text was updated successfully, but these errors were encountered: