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

svelte-kit sync doesn't run everytime on postinstall for pnpm #5779

Closed
brian14708 opened this issue Aug 1, 2022 · 6 comments · Fixed by #6339
Closed

svelte-kit sync doesn't run everytime on postinstall for pnpm #5779

brian14708 opened this issue Aug 1, 2022 · 6 comments · Fixed by #6339
Labels
bug Something isn't working p1-important SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.
Milestone

Comments

@brian14708
Copy link
Contributor

brian14708 commented Aug 1, 2022

Describe the bug

After following the instruction

`svelte-kit sync` now runs on "postinstall" — please remove the "prepare" script from your package.json

Sometimes pnpm run check fails in a clean workspace (git clean / CI).

I believe it has something to do with pnpm's side-effects-cache. It seems to fixed after disabling side-effects-cache in .npmrc

Reproduction

npm create svelte@latest test-postinstall
cd test-postinstall
pnpm i
rm -rf node_modules .svelte-kit
pnpm i
## no .svelte-kit folder
pnpm run check ## <-- FAIL

Logs

No response

System Info

npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.64 
    @sveltejs/kit: next => 1.0.0-next.401 
    svelte: ^3.46.0 => 3.49.0 
    vite: ^3.0.0 => 3.0.4

Severity

serious, but I can work around it

Additional Information

No response

@dominikg
Copy link
Member

dominikg commented Aug 1, 2022

There are two issues on pnpm repo related to this:

  1. Adding more variables to the side-effects-cache key pnpm/pnpm#5002
  2. Add option to re-run dependency scripts (install/postinstall) pnpm/pnpm#1394

Disabling the side-effects-cache globally in users projects may result in extra work.
Alternative / workaround would be to ensure that sync is run before check aswell, either by prepending it to the created script: "check":"svelte-kit sync && ... or by check itself inspecting the project and calling sync if it is svelte-kit.

@benmccann benmccann added this to the 1.0 milestone Aug 1, 2022
@benmccann benmccann added bug Something isn't working p1-important SvelteKit cannot be used by a large number of people, basic functionality is missing, etc. labels Aug 1, 2022
@indaco

This comment was marked as off-topic.

@dominikg

This comment was marked as off-topic.

@Rich-Harris

This comment was marked as off-topic.

@indaco

This comment was marked as off-topic.

@Rich-Harris
Copy link
Member

The solution here is to run svelte-kit sync before check, as happens for new projects after #6037 and #6339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1-important SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants