-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Ssr doesn't work if use getContext in entries.ts 's defineRouter/getComponent #104
Comments
Thanks for reporting! |
No, if you commont out L162, all the waku/src/lib/middleware/ssr.ts Lines 98 to 104 in 5af1c34
|
Oh, yeah, that's right.. I think we should avoid using |
Oh, I wasn't aware that could happen. (So, it's a bug...) Right, I think how we handle Let's tackle them separately. |
What's the issue
I use ssr with
routes
andgetContext
As the code show, it doesn't work if use
getContext
in defineRouter/getComponent.https://github.com/EasonYou/waku-example/blob/71308df89396c7fa6b5c9ce54ff46d8fafcdf7aa/src/entries.ts#L1-L21
What do I find
The error tells that ctx was empty, it cause by the
getComponent
so that waku can't get element bygetSsrConfig
because of the component import error. Then the ssr will not work. But no error on the client side, just like a csr app.waku/src/router/server.ts
Lines 155 to 171 in 5af1c34
I don't know if it is a purposeful design that user can't use
getSsrConfig
or it is a bug.The text was updated successfully, but these errors were encountered: