Closed kishor-dabi closed 5 years ago
Hi @kishor-dabi, Thanks for using dataframe-js. This warning occurs when you try to write a file when you are in the browser (where the module fs doesn't exist). However the warning message seems wrong.
Can you give more informations about your usage ?
@Gmousse Thanks for reply, I am Using dataframe-js in angular 6. I have install dataframe-js using npm. "npm i dataframe-js"
but it give warning at compile time and build time
WARNING in ./node_modules/dataframe-js/lib/reusables.js Module not found: Error: Can't resolve 'fs' in '/home/kishoredabi/Desktop/inv_master/core-web-inventory/core-web/node_modules/dataframe-js/lib'
The version of datafrane-js and other is: node : 8.11, dataframe-js: ^1.3.2, anlgular-cli: 6.1.3
I have the same warning while compile. I do not write file at all.
hi @maihannijat, I m currently modifying the library build. It's possible that the new release can fix this. Can you test with the branch feature/upgrade-babel ?
Thank you
Steps taken:
1- Removed dataframe-js directory from node_modules
2- Installed with npm install git+https://github.com/Gmousse/dataframe-js.git#feature/upgrade-babel
3- Run the development environment
Result:
WARNING in ./node_modules/dataframe-js/lib/reusables.js Module not found: Error: Can't resolve 'fs' in '/Users/mnijat/Desktop/oneplatform/frontend/node_modules/dataframe-js/lib'
Confirmation:
I have the following in package.json:
"dataframe-js": "git+https://github.com/Gmousse/dataframe-js.git#feature/upgrade-babel",
Ok strange... I will continue to look for a solution .
After looking a bit, it s related to webpack (or similar) which resolves the require fs at build time and fails even if the require has a try catch block.
Can you try to add:
In your webpack config:
node: {
fs: "empty"
}
Or if you can t, in your package.json:
"browser": {
"fs": false
}
If it works I will see if I can add it in the library s package.json.
Tried the following and it did not help:
"browser": {
"fs": false
}
Ok. Can you give me your webpack, node versions, and your webpack config (if possible) to reproduce this error. Indeed, on my side I can build with rollup or webpack without errors.
Node version: v10.9.0 I am using with the following project: https://github.com/akveo/ngx-admin
You will get the error if you clone and add the package there.
After a quick investigation, it seems its related to angular: https://github.com/angular/angular-cli/issues/10681
Indeed, the require is clearly try catched in dataframe-js and should work anyway. It's related to how angular build its bundle.
It seems adding
"browser": {
"fs": false
}
in the library package.json resolves your issue (I have no longer warning with your repository). Could you try to reinstall "dataframe-js": "git+https://github.com/Gmousse/dataframe-js.git#feature/upgrade-babel", and retry ?
The error is gone with above instructions but it broke my project. I get the following error in the browser console and the project does not load:
ERROR Error: "Uncaught (in promise): ReferenceError: global is not defined
I removed the package and installed the stable version and the project is running but with same warning.
Sorry ! js environment can be a torment sometimes.
I will continue to work on it. Stay tuned.
@maihannijat it's a bit strange. I have cloned your repo, use my upgrade-babel branch and it seems to work (without displaying the warning anymore). I don't understand.
Hi @maihannijat
My feature was merged with the develop branch. It works with your project (without the warning). Feel free to test the develop branch (it can be cool to have feedbacks).
I will close the issue after the release 1.4.0 (in a week).
Any ETA on when 1.4.0 will be released with this fix?
Hi ! I will try to work on the library to release the 1.4.0 asap. This week I hope. Could you try the develop branch ? The fix is merged.
@bluehazetech I m working to deliver the 1.4.0 as soon as possible. Feel free to test the develop branch via #72
when using dataframe-js it give warning:
WARNING in ./node_modules/dataframe-js/lib/reusables.js Module not found: Error: Can't resolve 'fs' in '/home/kishoredabi/Desktop/inv_master/core-web-inventory/core-web/node_modules/dataframe-js/lib'