Skip to content

Rollup build error when hub: { database: true } #669

@Yizack

Description

@Yizack

Describe the bug
Hello, when I set database to true, a rollup error occurs during build.

My reproduction is a simple Nuxt app with @nuxthub/core and database enabled, no other modules are installed.

This started happening since @rollup/[email protected] I guess that they added some strict checks and [email protected] is installing an outdated version of picomatch from other transitive dependencies.

If I remove database, it builds normally.

My current workaround is to override picomatch to 4.0.3

# pnpm-workspace.yaml
overrides:
  picomatch: ^4.0.3

or

// package.json
"pnpm": {
  "overrides": {
    "picomatch": "^4.0.3"
  }
}

Related:

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/github-k6ukhtxm-pkgmxhqi?file=nuxt.config.ts
  2. Wait for install and build
  3. See error

Logs

[nitro 1:15:47 PM]  ERROR  RollupError: node_modules/.pnpm/[email protected]/node_modules/picomatch/lib/constants.js (2:7): "default" is not exported by "node:path?commonjs-external", imported by "node_modules/.pnpm/[email protected]/node_modules/picomatch/lib/constants.js".


1: import * as commonjsHelpers from "commonjsHelpers.js";
2: import require$$0 from "\u0000node:path?commonjs-external";
          ^
3: 
4: 'use strict';


[1:15:47 PM]  ERROR  node_modules/.pnpm/[email protected]/node_modules/picomatch/lib/constants.js (2:7): "default" is not exported by "node:path?commonjs-external", imported by "node_modules/.pnpm/[email protected]/node_modules/picomatch/lib/constants.js".

    at getRollupError (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/parseAst.js:568:41)
    at Module.error (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/parseAst.js:564:42)
    at Module.error (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:16964:29)
    at Module.traceVariable (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:17416:29)
    at ModuleScope.findVariable (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:15086:39)
    at Identifier.bind (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:5438:40)
    at VariableDeclarator.bind (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:2829:23)
    at VariableDeclaration.bind (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:2825:28)
    at Program.bind (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:2825:28)
    at Module.bindReferences (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:16943:18) 



[1:15:47 PM]  ERROR  node_modules/.pnpm/[email protected]/node_modules/picomatch/lib/constants.js (2:7): "default" is not exported by "node:path?commonjs-external", imported by "node_modules/.pnpm/[email protected]/node_modules/picomatch/lib/constants.js".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions