Skip to content

Don't force hoisting #1385

@cdtut

Description

@cdtut

Describe the bug

dev

[vite] Internal server error: Failed to resolve import "vue" from "../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@slidev/client/main.ts?v=7928d2f5". Does the file exist?`

build

[vite]: Rollup failed to resolve import "vue" from "../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@slidev/client/main.ts".`
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`

Is there workaround? We can't use pnpm hoisting please consider workaround or let it work without hoisting otherwise can't use it because project cant be outside our monorepo.

No reason for project to need hoisting this requirement should be removed.

To Reproduce
Use pnpm and start slidev in package in monorepo.

I use lot of vite based products that have lot of dependencies but vite does not have problem to find those in sub directory. They dont need to enable hoisting they work in default way.

Why it works in every product but not slidev? If you can help me understand I can try think solution.

In repo/packages/project/slideproject/node_modules I only see .bin, .vite, @slidev (with cli under it) and playwright-chromium. @slidev/cli and playwright-chromium are the only 2 dependencies I set in package.json.

Shouldn't all dependencies of slidev be in repo/packages/project/slideproject/node_modules or repo/packages/project/slideproject/node_modules/@slidev/cli/node_modules (but there is only .bin there)?

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