Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Not all json files exported sapper export #1078

Closed
mhkeller opened this issue Jan 30, 2020 · 3 comments
Closed

Not all json files exported sapper export #1078

mhkeller opened this issue Jan 30, 2020 · 3 comments

Comments

@mhkeller
Copy link

Describe the bug

I have a project with a route like src/routes/example/[slug].svelte and src/routes/example/[slug].json.js but when I run sapper export --legacy in my project, it doesn't always export every json file for every slug. It seems like there's a race condition of some kind because sometimes it exports three, sometimes it exports all five.

To Reproduce

I made a branch called bug on this repo.

degit mhkeller/layercake.graphics#bug test-bug
cd test-bug
npm install
npm run export

Check out the folder docs/example/and you will see maybe all five json files corresponding to the exported folders.

Expected behavior

I expect all json files to be baked for every corresponding slugged route.

Information about your Sapper Installation:

  • Sapper version 0.27.9

  • Svelte version 3.18.1

  • Running rollup

Severity

I think this is pretty severe since it leads to some pages 404'ing in certain scenarios. I've fixed it temporarily by copying the exported json files when it does work and manually putting them in my export folder.

@bummzack
Copy link

Seems like this is a duplicate of #893.
Somebody already provided a PR (#869) that should fix this, but it's yet to be merged.

@swyxio
Copy link

swyxio commented Jan 31, 2020

yea try using @ssgjs/sapper

i dont intend to maintain this much longer, probably gonna drop sapper entirely

@mhkeller
Copy link
Author

@bummzack thanks I missed that in my search! I'll close this one

zhammer added a commit to zhammer/writing that referenced this issue Oct 3, 2020
i've spent so much time trying to figure out why sapper export often
misses exporting the [slug].json for certain pages. in b0b3b83 i
assumed the issue was (somehow) using hyphens in slugs so switched
to using underscores but this started happening again.

i found the followng issues which all are "closed" or "merged" but
this is _definitely_ still a bug. ended up looking at options for the
sapper export command and saw i can turn off concurrent requests,
which seems to have fixed the issue.
- sveltejs/sapper#1078
- sveltejs/sapper#893
- sveltejs/sapper#869

hoping to submit a repro of the issue to sapper soon
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants