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

Bad publish in @sveltejs/adapter-auto@1.0.1 breaking all builds (Netlify Vercel etc) #8530

Closed
swyxio opened this issue Jan 14, 2023 · 21 comments · Fixed by #8532
Closed

Bad publish in @sveltejs/adapter-auto@1.0.1 breaking all builds (Netlify Vercel etc) #8530

swyxio opened this issue Jan 14, 2023 · 21 comments · Fixed by #8532
Labels
bug Something isn't working p0-urgent SvelteKit is broken or vulnerable for most users

Comments

@swyxio
Copy link
Contributor

swyxio commented Jan 14, 2023

Describe the bug

fyi @Rich-Harris - #8522 broke adapter-netlify because the index.js stopped being published. see below


noticed my builds started failing 1hr after adapter-netlify 1.0.2 was published

adapter-auto gave this error:
image

then installing adapter-netlify gave this:

image

Reproduction

https://app.netlify.com/sites/swyxkit/deploys/63c33bd649e9cb0009b443fe

Logs

first 


6:34:11 PM: found 0 vulnerabilities
6:34:11 PM: error during build:
6:34:11 PM: Error: Could not install @sveltejs/adapter-netlify. Please install it yourself by adding it to your package.json's devDependencies and try building your project again.
    at get_adapter (file:///opt/build/repo/node_modules/@sveltejs/adapter-auto/index.js:87:11)
6:34:11 PM:     at async adapt (file:///opt/build/repo/node_modules/@sveltejs/adapter-auto/index.js:112:19)
6:34:11 PM:     at async adapt (file:///opt/build/repo/node_modules/@sveltejs/kit/src/core/adapt/index.js:28:2)
6:34:11 PM:     at async Object.handler (file:///opt/build/repo/node_modules/@sveltejs/kit/src/exports/vite/index.js:611:6)
6:34:11 PM:     at async PluginDriver.hookParallel (file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:23322:17)
6:34:11 PM:     at async Object.close (file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:24674:13)
6:34:11 PM:     at async Promise.all (index 0)
6:34:11 PM:     at async build (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:45411:13)
6:34:11 PM:     at async CAC.<anonymous> (file:///opt/build/repo/node_modules/vite/dist/node/cli.js:808:9)

then

6:37:40 PM: 
6:37:40 PM: > Using @sveltejs/adapter-auto
6:37:40 PM: error during build:
6:37:40 PM: Error: Cannot find module '/opt/build/repo/node_modules/@sveltejs/adapter-netlify/index.js' imported from /opt/build/repo/x.js
6:37:40 PM:     at new NodeError (file:///opt/build/repo/node_modules/import-meta-resolve/lib/errors.js:277:5)
6:37:40 PM:     at finalizeResolution (file:///opt/build/repo/node_modules/import-meta-resolve/lib/resolve.js:267:11)
6:37:40 PM:     at moduleResolve (file:///opt/build/repo/node_modules/import-meta-resolve/lib/resolve.js:1110:10)
6:37:40 PM:     at defaultResolve (file:///opt/build/repo/node_modules/import-meta-resolve/lib/resolve.js:1248:15)
6:37:40 PM:     at resolve (file:///opt/build/repo/node_modules/import-meta-resolve/index.js:30:12)
6:37:40 PM:     at import_from_cwd (file:///opt/build/repo/node_modules/@sveltejs/adapter-auto/index.js:41:20)
6:37:40 PM:     at get_adapter (file:///opt/build/repo/node_modules/@sveltejs/adapter-auto/index.js:60:18)
6:37:40 PM:     at adapt (file:///opt/build/repo/node_modules/@sveltejs/adapter-auto/index.js:112:25)
6:37:40 PM:     at adapt (file:///opt/build/repo/node_modules/@sveltejs/kit/src/core/adapt/index.js:28:8)
6:37:40 PM:     at Object.handler (file:///opt/build/repo/node_modules/@sveltejs/kit/src/exports/vite/index.js:611:12)


### System Info

```Shell
System:
    OS: macOS 11.3.1
    CPU: (8) x64 Apple M1
    Memory: 65.08 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.18.1 - /var/folders/h_/1lq46tdj7jdbs0j1m5l6rlb00000gn/T/fnm_multishell_630_1673705335772/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.19.2 - /var/folders/h_/1lq46tdj7jdbs0j1m5l6rlb00000gn/T/fnm_multishell_630_1673705335772/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Firefox: 94.0.2
    Safari: 14.1
  npmPackages:
    @sveltejs/adapter-auto: 1.0.0 => 1.0.0
    @sveltejs/adapter-netlify: ^1.0.2 => 1.0.2
    @sveltejs/kit: 1.0.1 => 1.0.1
    svelte: ^3.55.0 => 3.55.0
    vite: ^4.0.1 => 4.0.1

Severity

blocking all usage of SvelteKit

Additional Information

No response

@swyxio
Copy link
Contributor Author

swyxio commented Jan 14, 2023

1.0.2 seems to be missing index.js

image

but 1.0.1 has it

image

@swyxio
Copy link
Contributor Author

swyxio commented Jan 14, 2023

i suspect this affects all the other adapters as well as i can see adapter-vercel has the same issue

@swyxio swyxio changed the title Bad publish in @sveltejs/adapter-netlify@1.0.2 breaking builds Bad publish in @sveltejs/adapter-auto@1.0.1 breaking all builds (Netlify Vercel etc) Jan 15, 2023
@AgarwalPragy
Copy link

Same issue with Vercel

05:40:48.125 | Error: Could not install @sveltejs/adapter-vercel. Please install it yourself by adding it to your package.json's devDependencies and try building your project again.
05:40:48.125 | at get_adapter (file:///vercel/path0/node_modules/.pnpm/@sveltejs+adapter-auto@1.0.1_@sveltejs+kit@1.1.1/node_modules/@sveltejs/adapter-auto/index.js:87:11)
05:40:48.125 | at async adapt (file:///vercel/path0/node_modules/.pnpm/@sveltejs+kit@1.1.1_svelte@3.55.1+vite@4.0.4/node_modules/@sveltejs/kit/src/core/adapt/index.js:28:2)
05:40:48.125 | at async Object.handler (file:///vercel/path0/node_modules/.pnpm/@sveltejs+kit@1.1.1_svelte@3.55.1+vite@4.0.4/node_modules/@sveltejs/kit/src/exports/vite/index.js:664:6)
05:40:48.126 | at async PluginDriver.hookParallel (file:///vercel/path0/node_modules/.pnpm/rollup@3.9.1/node_modules/rollup/dist/es/shared/rollup.js:23582:17)
05:40:48.126 | at async Object.close (file:///vercel/path0/node_modules/.pnpm/rollup@3.9.1/node_modules/rollup/dist/es/shared/rollup.js:24937:13)
05:40:48.126 | at async Promise.all (index 0)
05:40:48.126 | at async build (file:///vercel/path0/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:44352:13)
05:40:48.126 | at async CAC.<anonymous> (file:///vercel/path0/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/cli.js:808:9)

@arackaf
Copy link

arackaf commented Jan 15, 2023

If anyone else finds this, in the Vercel camp, your workaround is

npm i @sveltejs/adapter-vercel@1.0.2 --save-dev

I suspect

@sveltejs/adapter-auto@1.0.0

would also work but I haven't tested

@k0d3r1s
Copy link

k0d3r1s commented Jan 15, 2023

excelent timing for starting to learn svelte to get a buggy adapter-node package with missing file, frustration is through the roof

@arackaf
Copy link

arackaf commented Jan 15, 2023

@k0d3r1s bro chill - there's a workaround above, besides, this only affects your ability to deploy to Vercel (or Netlify). You can still fire up npm run dev and learn as much as you want

@k0d3r1s
Copy link

k0d3r1s commented Jan 15, 2023

@arackaf nope, i'm new to frontend so i'm not doing ts version for learning but js one. locally yarn add @sveltejs/adapter-node added version without .js file which led to Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/www/html/app/node_modules/@sveltejs/adapter-node/index.js' imported from /var/www/html/app/svelte.config.js which i couldn't figure out. great that there is a workaround but it is impossible to find this issue without looking through issues as googling adapter-node missing index.js file did not lead to anything

@arackaf
Copy link

arackaf commented Jan 15, 2023

@k0d3r1s welcome to front-end development, where everything is held together by the heroic, usually unpaid efforts of OSS maintainers. Expect frustrating errors from time to time, and expect to be capable of searching, poking around, and being willing to figure out how to fix. If that's too much for you, then this might not be the best career field for you.

Either way, showing up in GitHub threads talking shit like this is a great way to wear out your welcome, and ensure nobody will ever want to help you.

@arackaf
Copy link

arackaf commented Jan 15, 2023

For everyone else, my purported workaround above ... stopped working. And pinning to

"@sveltejs/adapter-auto": "1.0.0"

also failed to work. Anyone know how to work around this?

@k0d3r1s
Copy link

k0d3r1s commented Jan 15, 2023

@arackaf i expressed my thoughts. how is that talking shit? as this is an obvious bug, are people not allowed to complain? i get that frontend packages are buggy mess but that doesn't mean people need to write only good things about it

@arackaf
Copy link

arackaf commented Jan 15, 2023

@k0d3r1s Go vent your frustrations on your personal blog or social media, not in the maintainer's GitHub thread

@arackaf
Copy link

arackaf commented Jan 15, 2023

Ok this seems to work for me

    "@sveltejs/adapter-auto": "1.0.0",
    "@sveltejs/adapter-vercel": "1.0.2",

kill your node_modules, and your lock file, and re-install, and that should hopefully work

@saibotsivad
Copy link
Contributor

Yep, same problem with @sveltejs/adapter-cloudflare-workers@1.0.4 missing the index.js file. Ouch. ❤️

@stalkerg
Copy link
Contributor

@sveltejs/adapter-node same issue

@stalkerg
Copy link
Contributor

#8519 this is reason :)

@arackaf
Copy link

arackaf commented Jan 15, 2023

:-)

image

@bluwy bluwy mentioned this issue Jan 15, 2023
5 tasks
@NormandoHall
Copy link

Again and again and again...

@bluwy bluwy added p0-urgent SvelteKit is broken or vulnerable for most users bug Something isn't working labels Jan 15, 2023
kwaa added a commit to importantimport/urara that referenced this issue Jan 15, 2023
@AgarwalPragy
Copy link

The npm package is still at 1.0.1 which breaks the Vercel build. Any chance of a release with @dominikg 's fix?

The solution #8530 (comment) works, but is not a permanent fix because manually installing the adapter defeats the purpose of adapter-auto.

@saibotsivad
Copy link
Contributor

@dominikg looks like the release didn't happen because the last changeset #8533 failed, when you merged it for the #8532 fix: https://github.com/sveltejs/kit/actions/runs/3922264089

ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with sites/kit.svelte.dev/package.json

I don't know pnpm but I guess probably just need to run an install or update locally to get it working again?

@Conduitry
Copy link
Member

The looks like an unrelated issue, and was fixed with #8534. The real issue presumably is that #8532 did not also update the auto adapter appropriately.

@Conduitry
Copy link
Member

Never mind, it sounds like the auto adapter did not need fixing.

https://unpkg.com/@sveltejs/adapter-auto@1.0.1/package.json The auto adapter does not directly depend on any of the other adapters. The versions of the other adapters do not end up in your lockfile unless you directly install them. If you are facing an issue still while using the auto adapter, I'm guessing Vercel is caching your build because your checked-in code has not changed.

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.

9 participants