ReferenceError: document is not defined #14060
Replies: 9 comments 11 replies
-
:) same here see #14071 |
Beta Was this translation helpful? Give feedback.
-
Where are you using In order to use a component that references You could conditionally load this component by checking if You could also instead import this component using a dynamic import with |
Beta Was this translation helpful? Give feedback.
-
@jamesmosier i do not use document or window anywhere, but when i build it webpack add some codes that includes also after reading #14071 , i have changed my component to
and still get same error, whats the problem with |
Beta Was this translation helpful? Give feedback.
-
the problem was the |
Beta Was this translation helpful? Give feedback.
-
Also please take a look at your imports. Sometimes, auto-import makes mistakes. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do something very similar to @Team-OF. Using This would be crazy if I had a library of hundreds of components but only needed one of the components and its associated styles. Any thoughts? |
Beta Was this translation helpful? Give feedback.
-
I am also facing the same issue, I get the error when I import bootstrap.js, without the bootstrap import, everything works fine. |
Beta Was this translation helpful? Give feedback.
-
Also seeing this issue, none of these solutions seem acceptable from a performance perspective. The only think I could think of is to shift the transpiling/compiling over to next.js and just import the source instead. |
Beta Was this translation helpful? Give feedback.
-
If anyone is still stuck on this issue with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hello next community
i am trying to create a simple UI library using react for Nextjs 9.4, here what i am doing
and made an index to export all modules for simplicity
also here is my webpack config to build for SSR Next
1-i build
2-publush on npm
3-import in Nextjs
then everything works well , but the problem is when i try to refresh (F5) the page during development i get the error
how can i fix that ?
Beta Was this translation helpful? Give feedback.
All reactions