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

Application code shouldn't be executed during build even when prerendering is not explicitly disabled #4619

Closed
aradalvand opened this issue Apr 14, 2022 · 2 comments

Comments

@aradalvand
Copy link
Contributor

aradalvand commented Apr 14, 2022

Describe the bug

This bug was explained in #4492, and #4604 was supposed to solve the issue, but it only does so if you explicitly disable prerendering in the configuration.
But it still makes no sense to me why SvelteKit would execute application code during build by default for adapter-node.

Reproduction

Described in #4492

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Memory: 983.98 MB / 7.89 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.5.5 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (100.0.1185.39)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.73 => 1.0.0-next.73
    @sveltejs/kit: ^1.0.0-next.312 => 1.0.0-next.312
    svelte: ^3.46.4 => 3.47.0

Severity

serious, but I can work around it

Additional Information

No response

@aradalvand aradalvand changed the title SvelteKit v1.0.0-next.312 still having the problem described in #4492 Application code shouldn't be executed during build even when prerendering is not explicitly disabled Apr 14, 2022
@Rich-Harris
Copy link
Member

This is not a bug, nor is it a recent change. If prerendering is enabled, SvelteKit needs to run your app. If you don't want to run your app during build, disable prerendering.

@aradalvand
Copy link
Contributor Author

aradalvand commented Apr 14, 2022

If prerendering is enabled

@Rich-Harris But it isn't. And I'm assuming prerendering is disabled by default, isn't it?! Then why do you need to explicitly set config.kit.prerender.enabled to false for this to take effect?!

Update: Please do post a comment to enlighten me after downvoting this, a thumbs-down isn't helpful on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants