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

Prepass is not resolving lazy imports #3

Closed
droganov opened this issue Jun 3, 2020 · 2 comments
Closed

Prepass is not resolving lazy imports #3

droganov opened this issue Jun 3, 2020 · 2 comments

Comments

@droganov
Copy link

droganov commented Jun 3, 2020

I'm able to get through the pre-pass stage, but at the render stage, I get pending promise error.

So it looks like lazy imports are not resolved by pre-pass.

I have a boilerplate (the pre-pass error is in the branch prepass-ssr-issue):
https://github.com/r-k-t-a/starter/tree/prepass-ssr-issue

Prepass use:
https://github.com/r-k-t-a/starter/blob/prepass-ssr-issue/src/koa/routes/defaultRoute/defaultRoute.tsx#L40

Lazy imports:
https://github.com/r-k-t-a/starter/blob/prepass-ssr-issue/src/App.tsx

@sventschui
Copy link
Member

sventschui commented Jul 19, 2020

Sorry for the late reply.

The issue is that currently Suspense will swallow the thrown promise during prepass. I added a failing test in #11 . I could not yet come up with a nice way to make Suspense a no-op during prepass.

As a workaround you could replace Suspense with Fragment during SSR/prepass for now.

@sventschui
Copy link
Member

[email protected] is now handling Suspense the same way as Fragments and thus fixes this issue.

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