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

sapper export: "UnhandledPromiseRejectionWarning: Error: Cannot add to a closed queue" #689

Closed
btakita opened this issue May 13, 2019 · 6 comments · Fixed by #698
Closed

Comments

@btakita
Copy link
Contributor

btakita commented May 13, 2019

This is due to not waiting for all requests to finish in a promise.

See https://github.com/sveltejs/sapper/blob/master/src/api/export.ts#L176

btakita added a commit to btakita/hbr-sapper that referenced this issue May 13, 2019
@halfnelson
Copy link
Contributor

This was clobbered by #641
the older code use q.add which allowed q.close to do the promise.all.

@kmelve
Copy link

kmelve commented May 16, 2019

We're hit by this as well, making it impossible to deploy our Sapper-starter on Netlify as a static site. It can be reproduced by deploying it through sanity.io/create.

It seems that async stuff in prefetch is the culprit? E.g https://github.com/sanity-io/sanity-template-sapper-blog/blob/master/template/web/src/routes/blog/%5Bslug%5D.svelte

@btakita
Copy link
Contributor Author

btakita commented May 16, 2019

@kmelve I manually go into the sapper source & modify the _export function in node_modules/sapper/dist/export.js to make the export work for now. Hopefully this will be fixed soon.

@btakita
Copy link
Contributor Author

btakita commented May 17, 2019

I created a temporary version that fixes this issue & #688

Use the following in your package.json

"sapper": "btakita/sapper#0.27.0-hotfix"

@kmelve
Copy link

kmelve commented May 17, 2019

Excellent @btakita – tnx 🙌

btakita added a commit to btakita/hbr-sapper that referenced this issue May 17, 2019
@antony
Copy link
Member

antony commented May 17, 2019

@kmelve I also believe there is an issue in the default configuration for the deployed app in your sapper starter - even with this hotfix the deploy will fail.

To deploy correctly you need to change the deploy directory from __sapper__/export to web/__sapper__/export.

Rich-Harris added a commit that referenced this issue May 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants