deno icon indicating copy to clipboard operation
deno copied to clipboard

Next 15 Error with Turbopack (Nextjs starter example)

Open VestaCord opened this issue 1 year ago • 4 comments

Version: Deno 2.1.3 (Tried on multiple 2.X.X versions) deno -A npm:create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example" runs ok

deno install --allow-scripts returns

Similar to closed issue #26742

error: Uncaught Error: spawnSync node-gyp ENOENT
    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:93:9)
    at __node_internal_errnoException (ext:deno_node/internal/errors.ts:141:10)
    at _createSpawnSyncError (ext:deno_node/internal/child_process.ts:685:17)
    at new ChildProcess (ext:deno_node/internal/child_process.ts:287:13)
    at Object.spawn (node:child_process:120:10)
    at build (file:///home/vestatian/Desktop/Deployments/nextjs-dashboard/node_modules/.deno/[email protected]/node_modules/node-gyp-build/bin.js:32:8)
    at preinstall (file:///home/vestatian/Desktop/Deployments/nextjs-dashboard/node_modules/.deno/[email protected]: failed to run scripts for packages: [email protected]

Then ok after I run deno install --allow-scripts again.

Issue comes with when I run deno run dev. This returns

Next.js
getServerError
node_modules/.deno/[email protected]/node_modules/next/src/client/components/react-dev-overlay/internal/helpers/node-stack-frames.ts (31:36)
getServerError
node_modules/.deno/[email protected]/node_modules/next/src/client/index.tsx (930:17)

Even more strangely, this error disappears if I delete the line import '@/app/ui/global.css'; from root layout (@/app/layout.tsx). This is code written by Vercel and works when running with Node + pnpm rather than Deno.

VestaCord avatar Dec 08 '24 11:12 VestaCord

I'm also getting this error and need to install pnpm install @tailwindcss/postcss

doveq avatar Jan 26 '25 05:01 doveq

I'm on Deno 2.1.7, and this still doesn't work. Next JS version: 15.1.6 (with React 19).

mintydev789 avatar Feb 01 '25 11:02 mintydev789

My best guess is that Turbopack was, well, not installed at all with deno install and then it became a ENOENT, since it cannot spawn the turbopack process (or load the library into node, which might also not be supported by deno)

stevefan1999-personal avatar Feb 21 '25 08:02 stevefan1999-personal

I believe Turbopack works as of Deno 2.3.3. At least it works for me.

mintydev789 avatar May 29 '25 18:05 mintydev789

Im getting the same error using Deno 2.3.5

dante-sparras avatar Jun 27 '25 19:06 dante-sparras