Skip to content

@unocss/postcss - Error: Cannot find module '.../node_modules/@unocss/postcss/dist/index.cjs' #5070

@vizet

Description

@vizet

UnoCSS version

66.6.0

Describe the bug

Getting this error in Next.js + PostCSS Uno integration, because index.cjs actually doesn't exists in @unocss/postcss/dist:

⨯ ./src/styles/global.sass.css
Error evaluating Node.js code
Error: Cannot find module '.../node_modules/@unocss/postcss/dist/index.cjs'
    [at createEsmNotFoundErr (node:internal/modules/cjs/loader:1441:15)]
    [at finalizeEsmResolution (node:internal/modules/cjs/loader:1430:15)]
    [at resolveExports (node:internal/modules/cjs/loader:661:14)]
    [at Function._findPath (node:internal/modules/cjs/loader:753:31)]
    [at Function._resolveFilename (node:internal/modules/cjs/loader:1391:27)]
    [at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)]
    [at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)]
    [at Function._load (node:internal/modules/cjs/loader:1215:37)]
    [at TracingChannel.traceSync (node:diagnostics_channel:322:14)]
    [at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)]

Import trace:
  Client Component Browser:
    ./src/styles/global.sass.css [Client Component Browser]
    ./src/app/layout.tsx [Server Component]

Reproduction

  1. Create Next.js project.
  2. Add postcss.config.mjs
  3. Add @unocss all in the global css/sass file

System Info

MacOS, Next.js

Validations

Metadata

Metadata

Assignees

No one assigned

    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