Skip to content

Problem with all versions above 0.7.0Β #2984

@sholohov

Description

@sholohov

Reproduction

It was not possible to reproduce the problem in the sandbox

Steps to reproduce the bug

On the Nuxt project https://nuxt.com/modules/pinia is installed. I installed versions upper than 0.7.0, and when building I get an error:

[nuxi 09:58:21]  ERROR  Nuxt Build Error: [vite]: Rollup failed to resolve import "pinia" from "/node_modules/@pinia/nuxt/dist/runtime/payload-plugin.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external

    at viteLog (/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:46345:15)
    at onRollupLog (/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:46395:5)
    at onLog (/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:46043:7)
    at /node_modules/rollup/dist/es/shared/node-entry.js:20765:32
    at Object.logger [as onLog] (/node_modules/rollup/dist/es/shared/node-entry.js:22644:9)
    at ModuleLoader.handleInvalidResolvedId (//node_modules/rollup/dist/es/shared/node-entry.js:21391:26)
    at /node_modules/rollup/dist/es/shared/node-entry.js:21349:26

error Command failed with exit code 1

Removing yarn.lock, node_modules and add 'pinia' to
build.rollupOptions.external does not help.

Expected behavior

The build runs without error.

Actual behavior

The build runs with error.

Additional information

Discussion started at nuxt/nuxt#29624

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