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

After SvelteKit 1.0.0-next.397, build hangs without displaying errors #5786

Closed
nstuyvesant opened this issue Aug 2, 2022 · 13 comments · Fixed by #5794
Closed

After SvelteKit 1.0.0-next.397, build hangs without displaying errors #5786

nstuyvesant opened this issue Aug 2, 2022 · 13 comments · Fixed by #5794
Labels
bug Something isn't working p0-urgent SvelteKit is broken or vulnerable for most users
Milestone

Comments

@nstuyvesant
Copy link
Contributor

nstuyvesant commented Aug 2, 2022

Describe the bug

After upgrading to any version of SvelteKit after 1.0.0-next.397, when running npm run build (vite build), it gets to a specific point in the process then never completes. No error messages:

% npm run build

> shy-svelte@3.0.3 build
> vite build

vite v3.0.4 building for production...
✓ 1737 modules transformed.

I am using vite@3.0.4 and @sveltejs/adapter-node@1.0.0-next.85. The version of these packages appears to have no effect on the inability to complete the build.

Reproduction

  1. git clone https://github.com/nstuyvesant/shy-svelte.git
  2. cd shy-svelte
  3. Change version of @sveltejs/kit to 1.0.0-next.398 in package.json (or change to "latest")
  4. npm install
  5. npx vite build (or npm run build) - use first one if you don't want to include my post-build script (will reproduce issue easily)

This build will never complete (or throw an error).

Change the SvelteKit version back to 1.0.0-next.397 and retry. Build will complete without problems.

Logs

% npm run build

> shy-svelte@3.0.3 build
> vite build

vite v3.0.4 building for production...
✓ 1737 modules transformed.

System Info

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.90 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    npm: 8.15.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 103.0.5060.134
    Firefox: 102.0.1
    Safari: 15.5
  npmPackages:
    @sveltejs/adapter-node: latest => 1.0.0-next.85 
    @sveltejs/kit: 1.0.0-next.397 => 1.0.0-next.397 
    svelte: ^3.49.0 => 3.49.0 
    vite: ^3.0.4 => 3.0.4

Severity

blocking an upgrade

Additional Information

Another person on Discord ran into this with their project as well. A change in 1.0.0-next.398 in combination with my project seems to be the cause.

@nstuyvesant nstuyvesant changed the title After SvelteKit 1.0.0-next.397, vite build never completes (and doesn't display an error) After SvelteKit 1.0.0-next.397, if /// <reference types="@sveltejs/kit" /> is left in app.d.ts, build hangs Aug 2, 2022
@nstuyvesant nstuyvesant changed the title After SvelteKit 1.0.0-next.397, if /// <reference types="@sveltejs/kit" /> is left in app.d.ts, build hangs After SvelteKit 1.0.0-next.397, build hangs Aug 2, 2022
@nstuyvesant nstuyvesant changed the title After SvelteKit 1.0.0-next.397, build hangs After SvelteKit 1.0.0-next.397, build hangs without display errors Aug 2, 2022
@dummdidumm
Copy link
Member

I'm very surprised that a duplicate reference to types makes this hang - wonder what's going on there. AFAIK vite doesn't even try to type-check, so why would it interfere with the build?

@nstuyvesant
Copy link
Contributor Author

nstuyvesant commented Aug 2, 2022

Actually - my mistake as I neglected to do an npm update so it was working with 1.0.0-next.397 (but not thereafter). So it's still an issue.

@nstuyvesant nstuyvesant changed the title After SvelteKit 1.0.0-next.397, build hangs without display errors After SvelteKit 1.0.0-next.397, build hangs without displaying errors Aug 2, 2022
camargo added a commit to NASA-AMMOS/aerie-ui that referenced this issue Aug 2, 2022
- Keep kit 1.0.0-next.397 until sveltejs/kit#5786 is fixed
@benmccann
Copy link
Member

@elliott-with-the-longest-name-on-github
Copy link
Contributor

Three changes in 398: https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md#100-next398

I'll try to take a look at this today. My bet is that the illegal module analysis may be entering a cyclical import and not breaking out like it should.

@nstuyvesant
Copy link
Contributor Author

On discord, saw some comments about builds getting very long (went from 30 seconds to 15 minutes) after 1.0.0-next.397. Perhaps related?

@benmccann
Copy link
Member

benmccann commented Aug 2, 2022

@tcc-sejohnson I think that is the cause. The build completes when I comment out the call to prevent_illegal_rollup_imports in writeBundle

There's another reproduction in #5784 (comment) that might have a few less dependencies in case it's any easier to debug against

@benmccann benmccann added bug Something isn't working p0-urgent SvelteKit is broken or vulnerable for most users labels Aug 2, 2022
@benmccann benmccann added this to the 1.0 milestone Aug 2, 2022
@nstuyvesant

This comment was marked as off-topic.

@cryptosmithio
Copy link

cryptosmithio commented Aug 2, 2022

I am seeing this too, but it's not hanging, just amazingly slow. For me, findSvelteDependencies takes around 15 minutes. Please find attached output of my build process. Line 1018 takes ~18 minutes.
build.out.txt

If if I downgrade to 1.0.0-next.397, my build is fine.

@nstuyvesant
Copy link
Contributor Author

nstuyvesant commented Aug 2, 2022

@jiyosub - Was looking at your build.out.txt - there is a private key in it so you should probably remove the file from your comment. I will delete what I just downloaded and wash my eyes out ;-)

@cryptosmithio
Copy link

cryptosmithio commented Aug 2, 2022

Thanks. Fixed that and rotated those keys. (Just vite dev server keys, but better safe than sorry)

@cryptosmithio
Copy link

On discord, saw some comments about builds getting very long (went from 30 seconds to 15 minutes) after 1.0.0-next.397. Perhaps related?

That was mine.

@nstuyvesant
Copy link
Contributor Author

Thanks! My build just completed with 1.0.0-next.402

@helmar81
Copy link

helmar81 commented Feb 2, 2023

Having similar issue:
error during build:
Error: ENOTEMPTY: directory not empty, rmdir '\?\C:\Users\User\my-CV.svelte-kit\output\server\chunks'

JosephVolosin pushed a commit to NASA-AMMOS/aerie-ui that referenced this issue Aug 20, 2024
- Keep kit 1.0.0-next.397 until sveltejs/kit#5786 is fixed
JosephVolosin pushed a commit to NASA-AMMOS/aerie-ui that referenced this issue Oct 21, 2024
- Keep kit 1.0.0-next.397 until sveltejs/kit#5786 is fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p0-urgent SvelteKit is broken or vulnerable for most users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants