-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Non-production builds still builds production SSR bundles #5573
Comments
What do you mean by a 'correct build'? In your reproduction, how does the observed behaviour differ from expectations? |
I've updated the reproduction. I expect |
it looks like You should be able to work around that by explicitly setting NODE_ENV to testing |
@dominikg That doesn't appear to be working, it's still building a production bundle for SSR. I've also tried switching to I've worked around the issue by adding a context-specific environment variable to my |
Ah, here's a hypothesis for the broken styles. Before hydration: <h1 class="svelte-mjk9ig">
<div class="welcome svelte-mjk9ig">
<picture
><source srcset="svelte-welcome.webp" type="image/webp" />
<img src="svelte-welcome.png" alt="Welcome" class="svelte-mjk9ig"
/></picture>
</div>
to your new<br />SvelteKit app
</h1> After hydration: <h1 class="s-Uap-jPRb-uiE">
<div class="welcome s-Uap-jPRb-uiE">
<picture class="s-Uap-jPRb-uiE"
><source
srcset="svelte-welcome.webp"
type="image/webp"
class="s-Uap-jPRb-uiE" />
<img src="svelte-welcome.png" alt="Welcome" class="s-Uap-jPRb-uiE"
/></picture>
</div>
to your new<br class="s-Uap-jPRb-uiE" />SvelteKit app
</h1> The difference is in the |
Oh hang on, I finally understand what @dominikg meant in #5573 (comment) 🤦 We call |
yes, i should've been clearer. the difference in cssHash is caused by the mode difference.
|
I'm a bit confused why explicitly setting |
* failing test for #5573 * remove some logging * add app.d.ts * use define to control dev/prod env values * tidy up * jeez * come on * changeset * remove redundant env (#5614) * remove redundant env * changeset * add meatier description * huh, cant use those in comments, they get replaced dangerously
Describe the bug
I'm trying to set up a dev/staging build step in my deploy pipeline, but can't convince Svelte Kit to produce a correct build. Not being able to do so means I can't add
noindex
tags to my pages, and dev sites could leak into search engines.Reproduction
Run
npm run build
on https://stackblitz.com/edit/sveltejs-kit-template-default-m2k71o?file=package.json&terminal=devLogs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
I can't run my usual workflow without this as I can't tell build which environment they're in.
The text was updated successfully, but these errors were encountered: