Node.js v22.x - [email protected] from [email protected] causing an error during server start in next.js
We’re encountering a problem with Next.js (v15) when using the latest version of isomorphic-dompurify (2.28.0) on Node.js v22.x (both locally and on Vercel). Error (Next.js v15, Node 22.x, during server start):
Error: ENOENT: no such file or directory, open '.../.next/browser/default-stylesheet.css'
at 80131 (.next/server/chunks/9049.js:80:184774)
at c (.next/server/webpack-runtime.js:1:485)
at 82681 (.next/server/chunks/9049.js:81:31137)
at c (.next/server/webpack-runtime.js:1:485)
at 86282 (.next/server/chunks/9049.js:82:267932)
at c (.next/server/webpack-runtime.js:1:485)
at 57165 (.next/server/chunks/9049.js:71:5350)
at c (.next/server/webpack-runtime.js:1:485)
at 29511 (.next/server/chunks/9049.js:21:403122) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '.../.next/browser/default-stylesheet.css'
}
Workaround
Adding the following to next.config.ts resolves the build for now:
serverExternalPackages: ["isomorphic-dompurify", "jsdom"]
#355
Thanks for reporting @riungemaina !
Experiencing the same. I saw in the previous thread that updating Node solved it for some people. We're on v22.16.0, however.
The workaround provided works in the meantime.
Same here:
- Next: 15.5.4
- Node: 22.18.0
Can it be related to the jsdom version?
▶ npm ls jsdom
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
└── [email protected]
Having the same issue. The workaround fixed it in the meantime.
Having the same issue. The workaround has been fixed for now. Thank you!
I’m using Next.js 15.5.6, and the workaround didn't work for me until I updated my package.json to override the parse5 version:
"pnpm": {
"overrides": {
"parse5": "^7.1.2"
}
}
After that, I ran pnpm install, and in production, I just redeployed , everything worked fine.