You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Is your feature request related to a problem? Please describe.
Right now I'm calling a GraphQL server in preload, which is running during dev but of course not after the app is exported. During the export process the data is fetched correctly and stored in the html as expected, but even when running exported the app continues to try to fetch this data.
Describe the solution you'd like
Be able to pass a flag to a Sapper app that the app is running in exported mode (like process.browser does for browser or server)
How important is this feature to you?
I'm working on a package that simplifies some GraphQL usages for the user in Sapper, but this is a major roadblock.
The text was updated successfully, but these errors were encountered:
I don't know a lot about how export works, but if it's basically the same as SSR then this sounds like it could be a duplicate of the svelte hydration issue sveltejs/svelte#4308. Once the page has already been rendered there's no need to rerun the scripts on the page except for installing event listeners. I wonder if you use the patched version of Svelte provided there if it will work.
If I comment out sapper.start({ target: document.querySelector('#sapper') });, that fixes it.... but I feel like there's probably a reason I definitely shouldn't do that
This sounds like it's a bit of an XY problem, so I'm hesitant to lean too far into this proposed solution - but if you can currently pass an environment variable to the sapper export command, it will be visible in the bundler config, and then you can do whatever you want with it - doing compile time string replacements or whatever you want. Rather than adding another bit of to Sapper that needs documenting, you can create it yourself.
Is your feature request related to a problem? Please describe.
Right now I'm calling a GraphQL server in preload, which is running during dev but of course not after the app is exported. During the export process the data is fetched correctly and stored in the html as expected, but even when running exported the app continues to try to fetch this data.
Describe the solution you'd like
Be able to pass a flag to a Sapper app that the app is running in exported mode (like process.browser does for browser or server)
How important is this feature to you?
I'm working on a package that simplifies some GraphQL usages for the user in Sapper, but this is a major roadblock.
The text was updated successfully, but these errors were encountered: