-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using casual with create-react-app
#86
Comments
Happened to me too with Vue.js, I think this library is not for Webpack - but for Node.js. I ended up using https://github.com/marak/Faker.js/ which worked fine. |
@liquidvisual Sadly, I didn't manage to fix this. It appears to be an issue with Webpack - I could reproduce it even with a simple Webpack config an a code similar to const fs = require('fs');
if (!fs) {
console.log('No FS!');
} When I executed the script without Webpack (i.e. using |
I fixed this issue by using
|
It produces an UMD module that can be used in browser and Node fix boo1ean#86
If you are running causal in the browser then you will need to tell webpack to bundle the Take a look at the node webpack configuration for instructions on how to bundle node APIs for consumption in the browser. |
Steps to reproduce:
create-react-app
, i.e.npm create react-app casual-test
yarn add casual
App.js
component like thisyarn start
The browser opens automatically and shows an error page saying
TypeError: exists is not a function
, pointing to this lineTested on macOs Mojave (10.14.3) and Windows 10 1803
A quick SO search revealed this similar issue (Webpack...).
The text was updated successfully, but these errors were encountered: