How can I use routing and export type of deploy?
Routing works fine with npm run build && npm start.
But with npm run export && npx serve __sapper__/export doesn't.
What am I doing wrong?
export generates a static site. src/server.js is used when generating, but not included in the final static site.
What type of routing do you want to do? What does your code look like?
It works fine in example app.
I created several routes, but at this stage export found only these.
> Built in 14.3s
> Crawling http://localhost:3000/
8.4 kB index.html
2.91 kB service-worker-index.html
I am also having this problem.
The export command isn't building all routes for some reason. I'm not sure what has changed, this was working for me until very recently. I haven't upgraded recently (I'm on alpha 8) but I have made some minor changes to my build process (plugins and a svelte preprocessor) but rolling back those changes doesn't seem to make any difference.
Looks like a bug but I haven't looked too deeply.
There's a nasty race condition with exports that somehow remained hidden until recently that might be responsible for this.
Yeah, I wondered if that could be causing the issue. I'll test it again when that change is in.
If you're using Svelte 3 and the recent Sapper alphas - the fix for this race condition has just been released in 0.26.0 alpha 11. Hopefully that fixes the weird stuff people have been seeing!
@Conduitry doesn't work for me :)
This doesn't work for me either. I am now getting errors when sapper tries to validate components that don't exist (they should exist). I'm guessing that sapper is choking on something and no creating the necessary components in my case. I thought it might be the preprocessor problem that was discussed recently (when creating routes) but removing that doesn't seem to make a difference.
Since these errors are new (for me) in beta11 and weren't present in beta10, as far I can recall anyway, I'm wondering if this PR will resolve any of my issues. I'll look into this more closely when I get the chance and have checked whether this PR alleviates any of my pains.
Also check out #596 which is specifically intended to restore some changes introduced in beta 10 and which were lost in beta 11.
Alpha 12 has been released with (theoretically) all of these changes, so check that out instead.
Should be fixed by #585.