Skip to content

Node.js v22.x - [email protected] from [email protected] causing an error during server start in next.js #356

@riungemaina

Description

@riungemaina

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions