VulcanJS / vulcan-npm

The full-stack JavaScript App Framework
https://vulcan-docs.vercel.app
MIT License
31 stars 8 forks source link

Isomorphic unfetch is failing at runtime server side, window not defined #4

Closed eric-burel closed 4 years ago

eric-burel commented 4 years ago

https://github.com/developit/unfetch/issues/104 https://github.com/developit/unfetch/issues/122

We should either improve the typeScript/webpack build process. Switching to cross-fetch does not work, as unfetch is probably also a dependency of a subpackage.

We might need to define window as global variable, set to undefined, in webpack.

developit commented 4 years ago

FWIW the only way you'd be seeing window is if the build system here (I'm not familiar with it) is incorrectly following isomorphic-unfetch's "browser" package.json mainField.

eric-burel commented 4 years ago

Yeah the build was messy, I was bundling the full node_modules with webpack. I think now it works correctly but our build system is not yet mature.