-
Notifications
You must be signed in to change notification settings - Fork 26
Server-side requests are broken #77
Comments
@beejunk Thank you, I was struggling with this and couldn't figure out what's happening |
@beejunk Thank you, this worked for us as well. import Waterwheel from 'waterwheel/lib/waterwheel' |
This also appears to be a problem specifically with In |
The problem is that using 'lib/whaterwheel.js' doesn't just work in all situations. For instance, the create-react-app build process fails when using 'lib/waterwheel.js', because the build script will not minify any third-party library that is not compiled to ES5 (see here for details.) This was previously the case with Waterwheel, and the change to exporting the 'dist' folder fixed that issue. Unfortunately, it created this issue as a result. So I don't think that rolling back would necessarily be a good idea. It may be better if the module exported code that has only been compiled from the source to ES5, instead of exporting code that has been completely bundled and uglified by Webpack. |
The same cannot import this lib in polymer 3 |
When attempting to make requests using Node.js on the server side, Waterwheel throws this error:
I believe this is because the module is exporting the Webpack bundle from the
dist
directory, and something about the bundle is tricking Axios into incorrectly believing that it is being run from the browser and not the server.A workaround is to import Waterwheel directly from the
lib
folder:This is not ideal, but it solves the problem.
The text was updated successfully, but these errors were encountered: