Skip to content

Browser bundle imports node:module.createRequire in >=66.5.11 (breaks Nuxt/Vite) #5049

@toniengelhardt

Description

@toniengelhardt

UnoCSS version

66.5.11 and 66.5.12

Describe the bug

Upgrading the following dependencies in my Nuxt project (ssr: false)

"@unocss/cli": "66.5.10", 
"@unocss/eslint-plugin": "66.5.10", 
"@unocss/nuxt": "66.5.10", 
"unocss": "66.5.10",

to vX.X.11 or vX.X.12 breaks my app with a 500:

(0 , import_node_module.createRequire) is not a function

ChatGPT 5.2 says it looks like the package is bundling node code into the browser bundle:

Image

Reproduction

Not sure how to reproduce this outside of my app...

System Info

No response

Validations

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions