-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
devalue cause crash on Netlify after update #6462
Comments
+1, after a @sveltejs/kit upgrade from
Edit: Seems to be caused by #6318 bumping devalue's version to 3.1.2 |
Having the same issue on vercel |
Looking at the https://github.com/Rich-Harris/devalue/blob/master/package.json Edit: tried patching the package via a diff applied using |
same here when deploying to netlify.
could it be for the same reason? repo that caused the issue on both netlify and vercel |
@demetrius-mp Doesn't look related. It says |
This issue is happening because the new version of
[build]
command = "npm run build"
publish = "build"
[functions]
node_bundler = "esbuild" # temporary workaround for https://github.com/sveltejs/kit/issues/6462
import netlify from '@sveltejs/adapter-netlify';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
+ adapter: netlify({ edge: true })
- adapter: netlify()
}
};
export default config; |
For those reporting a similar issue on Vercel -- can you provide a repro? I was able to reproduce this issue with a fresh demo project on Netlify, but not on Vercel. |
the issue i was having on vercel is not related to devalue, but to this |
Also crashes for me on adapter-node.
In another issue related to this, it was suggested that the problem could be fixed by setting "true" at "esModuleInterop": true,
|
The issue described in the OP is happening because Netlify doesn't support ESM (netlify/zip-it-and-ship-it#750), and recent versions of SvelteKit depend on Ultimately, this will continue to affect any app deployed to Netlify that has an ESM dependency — we've just been lucky not to stumble onto one until now. As more of the ecosystem goes ESM-only, this will happen more frequently. The reason this doesn't happen if you specify I think the solution is to adopt the same strategy @xpat looks like you have some out-of-date dependencies somewhere — if something is doing this... import devalue from 'devalue' ...it means it's expecting @rowantrollope seems like you have the opposite problem — that code expects |
Thanks Rich,
Confirmed! Somehow I had an old devalue installed. I didn't see it in my package.json so I don't know where it came from. Are there packages installed that don't show up in package.json?
At any rate, I just did a pnpm install ***@***.*** and that fixed the problem.
Out of curiosity (for others who run into this), how do I find the dependency that had installed the older devalue? If @sveltejs/kit requires ***@***.*** why wouldn't pnpm have installed it?
Thank you!
Rowan
Sent via Superhuman ( ***@***.*** )
…On Thu, Sep 01, 2022 at 4:58 PM, Rich Harris < ***@***.*** > wrote:
The issue described in the OP is happening because Netlify doesn't support
ESM ( netlify/ zip-it-and-ship-it#750 (
netlify/zip-it-and-ship-it#750 ) ), and recent
versions of SvelteKit depend on ***@***.*** which is an ESM package.
Ultimately, this will continue to affect any app deployed to Netlify that
has an ESM dependency — we've just been lucky not to stumble onto one
until now. As more of the ecosystem goes ESM-only, this will happen more
frequently.
The reason this doesn't happen if you specify node_bundler=esbuild is that
unlike the default zisi (zip-it-and-ship-it), esbuild bundles everything to
a single file rather than just zipping up stuff in node_modules. But
that's too blunt a remedy — esbuild can't bundle everything (i.e. native
dependencies).
I think the solution is to adopt the same strategy adapter-node has — use esbuild
within the adapter to bundle everything in devDependencies , but leave prod
dependencies unbundled. If you're using zisi then native dependencies will
continue to work, and if you're using esbuild then it will just get bundled
a second time, harmlessly.
@ xpat ( https://github.com/xpat ) looks like you have some out-of-date
dependencies somewhere — if something is doing this...
import devalue from 'devalue'
...it means it's expecting ***@***.*** , not ***@***.*** (which uses a named
export).
@ rowantrollope ( https://github.com/rowantrollope ) seems like you have
the opposite problem — that code expects ***@***.*** , but you might have ***@***.***
installed somehow?
—
Reply to this email directly, view it on GitHub (
#6462 (comment) ) , or
unsubscribe (
https://github.com/notifications/unsubscribe-auth/ACXKL5IZENZPRIIZMEWD44LV4E7LLANCNFSM6AAAAAAQBHSRKQ
).
You are receiving this because you were mentioned. Message ID: <sveltejs/kit/issues/6462/1234923477
@ github. com>
|
@geoffrich Thanks for that fix.. I tried it and it kind of worked. Most of the dynamic routes that were broken started working.. But other things started breaking. A few dynamic routes just wouldn't load on the live server. They would 404 and the data requests wouldn't even hit my backend. They all built and ran fine locally with pnpm build / pnpm preview. Just wanted to give a heads up. I obviously have tempered expectations using software that's in beta and am fine waiting for a fix. Let me know if there is anything I can do for you to help troubleshoot. Thanks for all your hard work :) |
I think I'm back in business on Netlify.
After doing both steps it works. My |
I was able to get something deployed by adding |
until sveltejs/kit#6462 resolves static > Using @sveltejs/adapter-static fails with error @sveltejs/adapter-static: all routes must be fully prerenderable (unless using the 'fallback' option — see https://github.com/sveltejs/kit/tree/master/packages/adapter-static#spa-mode). Try adding `export const prerender = true` to your root layout — see https://kit.svelte.dev/docs/page-options#prerender for more details run CI tests on both linux and windows using matrix strategy
* update deps * set vite dev and preview ports to 3000 * sveltekit '$app/env' renamed to '$app/environment' * determine active option not by label but by index in array of matchingOptions replace setOptionsVisible(bool) with open_dropdown() and close_dropdown() trigger close_dropdown() on touchstart outside (as well as click outside), select wasn't closing on mobile without that rename prop showOptions to open add props focusInputOnSelect: boolean | 'desktop' and breakpoint = 800 * document new props activeIndex, focusInputOnSelect, breakpoint in readme * document showOptions -> open rename in readme under recent breaking changes * improve description of Slot Components example * change web server command for testing to yarn dev (from server) * fix 2 broken tests using page.goto({ waitUntil: `networkidle` }) * switch to adapter-netlify for time being and use edge until sveltejs/kit#6462 resolves static > Using @sveltejs/adapter-static fails with error @sveltejs/adapter-static: all routes must be fully prerenderable (unless using the 'fallback' option — see https://github.com/sveltejs/kit/tree/master/packages/adapter-static#spa-mode). Try adding `export const prerender = true` to your root layout — see https://kit.svelte.dev/docs/page-options#prerender for more details run CI tests on both linux and windows using matrix strategy * tweak focusInputOnSelect readme docs
I'm also having the same problem. But when I change vite.config.js to like this const config = {
plugins: [sveltekit()],
ssr: {
noExternal: ['devalue']
}
}; everything is working normally and everything seems to be working |
This appears to have been fixed with #6666 -- my Netlify sites now work as expected on the latest adapter version. @wentallout (and others in this thread) can you remove any workarounds in |
Awesome - just updated packages to latest and removed the workaround from |
ok, I removed the work around on |
I updated all the packages to newest and everything works normally. |
Closing since the issue appears to have been fixed. |
Hmm, what am I missing? My package.json contains "@sveltejs/adapter-netlify": "next",
"@sveltejs/kit": "next", My netlify.toml looks like this [build]
command = "npm run build"
publish = "build"
[[plugins]]
package = 'netlify-plugin-contextual-env' and my vite.config.js import { sveltekit } from '@sveltejs/kit/vite';
import { imagetools } from 'vite-imagetools';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit(), imagetools()],
resolve: {
preserveSymlinks: true
}
};
export default config; I did |
@tedsteen can you paste the output of I can't repro on the SvelteKit demo app - can you provide a minimal repo reproducing the issue? |
BTW just tested out of curiosity what happens if @tedsteen Just |
❯ npx envinfo --npmPackages "{svelte,@sveltejs/*,vite}" npmPackages: |
Didn't make a difference (it seems like |
I'm not sure what happened, but now it works and I can't seem to revert to a broken version. |
Putting "devalue": "^3.1.3" in my dependencies section of package.json fixed it. |
Will try. FWIW I lBacked off the latest sveltekit build to sveltekit 443 , still had problem. Then explicitly removed devalue from package json: problem fixed.
Sent via Superhuman iOS ( ***@***.*** )
…On Thu, Sep 1 2022 at 4:22 PM, Geoff Rich < ***@***.*** > wrote:
For those reporting a similar issue on Vercel -- can you provide a repro?
I was able to reproduce this issue with a fresh demo project on Netlify,
but not on Vercel.
—
Reply to this email directly, view it on GitHub (
#6462 (comment) ) , or
unsubscribe (
https://github.com/notifications/unsubscribe-auth/ACXKL5OX2FXTYJ4BMKOBLKDV4E3ERANCNFSM6AAAAAAQBHSRKQ
).
You are receiving this because you commented. Message ID: <sveltejs/kit/issues/6462/1234896046
@ github. com>
|
Anyone else still/again seeing this in netlify builds with
https://app.netlify.com/sites/svelte-bricks/deploys/634f7f8bafaf8e0009a09e15#L153 |
@janosh I am currently using |
@brittneypostma I just |
According to <sveltejs/kit#6462 (comment)>
Describe the bug
I updated some sveltekit-related npm packages then
build
successfully on local/dev but when deployed it just crashed on NetlifyReproduction
package.json
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
I did look at some reports on discord and changed my vite version to "vite": "^3.1.0-beta.1",
The text was updated successfully, but these errors were encountered: