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
'document is undefined' with SSR #23
Comments
it should tree-shake. i've tried it, just using HTML and there is no mention of troika in the resulting bundle. are you in dev mode perhaps, or is there any other reason why it wouldn't shake off un-used dependencies? |
This seems like something that should be resolved by the project setup. |
He fixed it, could you try loading this lib in ssr? protectwise/troika#46 we're not sure if that's all that we need to do |
@drcmda Thanks for the follow-up! The undefined
It doesn't prevent the app from rendering, which is great, but it does add noise to logs. |
could you open a new ticket over there (troika)? there's nothing i can do here, other than messing with the build system, but would be great to keep the flatbundle for convenience. |
When importing drei in an app that renders with SSR, an error is thrown as
troika-3d-text
has multiple references to thedocument
object. This can be circumvented by loading components that require this using lazy or dynamic imports, but unfortunately, importing anything fromdrei
will bring introika-3d-text
, so it is impossible to, for example, use the awesome<HTML />
component for a loading state for the modules we want to lazy load that contain thesedocument
references.Here is the full error:
The text was updated successfully, but these errors were encountered: