-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ReferenceError: document is not defined #1440
Comments
I think this is related to this #1246 |
Unless you force next/webpack to use non-default settings for those: |
Having a similar issue if I change
As soon as I add this, it breaks my tests
Tests were passing before adding a custom snapshotSerializers |
@Vadorequest could you share repro case? |
Will try to when I OSS my project... Trying to build a boilerplate with everything pre-configured. :) |
Current behavior:
When importing build generated from create react app into ssr nextjs -> 'ReferenceError: document is not defined' error gets thrown
Library from is generated from create react app with the following webpack settings:
which works perfectly fine on browser but not on ssr
To reproduce:
Under pages I attached the built library that throws the error at line https://github.com/andreapiras/nextexample/blob/master/pages/main.js#L939
Expected behavior:
Expected the component to behave as it does on web and gets rendered with correct style on ssr env. At the moment is not possible to generate the library changing target to node.
Environment information:
Am I missing something?
Thank you
The text was updated successfully, but these errors were encountered: