Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Simple template not working out of the box on web #75

Open
jldinh opened this issue Feb 12, 2020 · 1 comment
Open

Simple template not working out of the box on web #75

jldinh opened this issue Feb 12, 2020 · 1 comment

Comments

@jldinh
Copy link

jldinh commented Feb 12, 2020

When running a newly instantiated simple template and opening it in a browser, it fails to load and an error in the console complains about exports not being defined in react-sharedb/lib/index.js.

I tracked it down to the webpack config not compiling node_modules dependencies by default, resulting in this error, because AFAIK exports only exists in Node and not in browsers.
Adding @startupjs/react-sharedb to forceCompileModules in webpack.web.config.js solves the problem, but I wonder if it wouldn't make more sense for react-sharedb's lib folder to be directly useable in a browser.

@jldinh
Copy link
Author

jldinh commented Feb 12, 2020

I also noticed a similar issue with the routing template, causing a parsing error in webpack. This problem is caused by the pug templates in @startupjs/app. Adding the module to forceCompileModules also fixes the error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant