TypeError: can't access property "document", this is undefined #2322
-
Hi everyone, I like a lot the Snowpack concept and I'm just start trying to migrate from Webpack to Snowpack a Typescript Reactjs installation with React-plotly and I get this error on runtime
this is the culpable 26076 line
I'm not sure if is just a configuration problem or something more deep. Maybe is trying to refer to the DOM and it can't find it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Interesting! I can't help with individual packages, but most likely something is happening in that package that breaks non-Webpack bundling. Snowpack is using Rollup internally to prepare your package, and it sounds like that's where the issue is coming from. I'd recommend reaching out to that project, and seeing if they'd be interested in fixing so that all Rollup, Snowpack, Vite, etc. projects can work with their package. |
Beta Was this translation helpful? Give feedback.
-
@FredKSchott thank you for the answer, I've open an issue on React-plotly repository, hoping they can help me. |
Beta Was this translation helpful? Give feedback.
Interesting! I can't help with individual packages, but most likely something is happening in that package that breaks non-Webpack bundling. Snowpack is using Rollup internally to prepare your package, and it sounds like that's where the issue is coming from.
I'd recommend reaching out to that project, and seeing if they'd be interested in fixing so that all Rollup, Snowpack, Vite, etc. projects can work with their package.