Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preact template doesn't work with pnpm #3

Open
rhendric opened this issue Jun 24, 2021 · 4 comments
Open

Preact template doesn't work with pnpm #3

rhendric opened this issue Jun 24, 2021 · 4 comments

Comments

@rhendric
Copy link

Out of the box, create-nollup-app --name test-app --template preact && cd test-app && pnpm i && pnpm start fails with

[Nollup] Listening on http://localhost:9001
ParseError: /src/@prefresh/core.js
Error: ENOENT: no such file or directory, open '.../test-app/src/@prefresh/core.js'
    at compileModule (.../test-app/node_modules/.pnpm/[email protected][email protected]/node_modules/nollup/lib/impl/NollupCompiler.js:200:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async compileInputTarget (.../test-app/node_modules/.pnpm/[email protected][email protected]/node_modules/nollup/lib/impl/NollupCompiler.js:231:5)
    at async Object.compile (.../test-app/node_modules/.pnpm/[email protected][email protected]/node_modules/nollup/lib/impl/NollupCompiler.js:302:31)
    at async generateImpl (.../test-app/node_modules/.pnpm/[email protected][email protected]/node_modules/nollup/lib/index.js:14:21)

Doesn't happen with the other templates, doesn't happen with npm. I'm evaluating switching to pnpm, so I'm not yet familiar enough with how it does things differently to offer a guess about why it breaks this, sorry!

@rhendric
Copy link
Author

Aha, adding @prefresh/core to devDependencies fixes it.

@PepsRyuu
Copy link
Owner

That... doesn't seem right. @prefresh/core is a direct dependency of @prefresh/nollup. This might be a bug with pnpm? Seems weird that it isn't installing a dependency of a dependency.

@PepsRyuu
Copy link
Owner

It looks like .pnpm does some sort of strange flattening of dependencies? That's definitely going to cause problems. I'm not entirely sure how that's fixed though... Not an issue related to create-nollup-app though.

@rhendric
Copy link
Author

The pnpm docs seem to indicate that this sort of thing usually happens because some package ought (in pnpm's opinion, I guess?) to have a dependency on another but doesn't. So maybe this is a Prefresh bug? But maybe the template should include @prefresh/core in the dependencies too? Honestly I don't know; I'm just feeling my way around here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants