-
Notifications
You must be signed in to change notification settings - Fork 4.7k
WebPack - Issue : Error: Can't resolve 'fs' #1764
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
Comments
+1 |
Duplicate of #1753 Do you have any possible solutions? I guess that it is not the first time such an issue exists? |
+1 |
Seems like you have to modify your webpack configuration https://jlongster.com/Backend-Apps-with-Webpack--Part-I So the solutions seems to be |
+1 |
I'm using the latest angular cli version, so webpack configuration is not a good solution for me. |
I think the issue is as we’ve added node support is it’s using that instead
during the webpack build. When it should be using the browser functions.
We may have to detect webpack...
On Tue, 22 May 2018 at 10:38, Zeev Katz ***@***.***> wrote:
I'm using the latest angular cli version, so webpack configuration is not
a good solution for me.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1764 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAC5s5kXAKFVuLQBHfjJztV-Oa3dM6B7ks5t09yEgaJpZM4UH0Jg>
.
--
James Hall
Director
Parallax Agency Ltd
M. 07894950320
|
I think the problem is, that webpack tries to resolve fs, because it scans the js-files. This can be fixed by the mentioned webpack configuration. This seems to be standard solution provided by webpack, as it is part of their documentation. What has to be done in an angular cli-version... well. I dont know. |
Well an ugly "hack" would be |
for webpack you can use
|
@arasabbasi At the moment I can't get angular to work with this version, and I don't want to eject my project into a webpack one. |
Same issue. We cannot update our projects to Angular6 because of this issue. Would appreciate any workaround. |
@lordgreg You can take a look here: The issue is using libraries that angular 6 isn't "built" for (namely fs). Looks like its affecting a lot of projects - gettext to name one. I couldn't get the "patch" fix to work yet. Will spend more time on it at some point. will currently stay at Angular 5. |
Thank you for your suggestion @inthegarage. I hope the issue actually lies in the support for Node which was added recently, as said by @MrRio. I'll wait for the update, otherwise its too much hacking involved 👍 💯 |
removed with Commit 7a1089a Will be part of v. 1.4.1 |
For now, a hack for Angular CLI 6 is this. And the reason why is not supported anymore, as stated in this comment is that they are trying to discourage libraries that run in the browser of using node globals. |
Well it would have been good to know these things. But it makes sense in some way for webpack devs... |
@arasabbasi when can we expect v1.4.1? |
Whether v1.4.1 can resolve this bug? |
when can we expect v1.4.1? I cannot build the app because of this issue. |
Because people are still posting |
I think you should release a build with this fix if possible as most of the people use webpack and this is a blocker. Thank you for the work so far 🚀 |
I am aware of that. Another big bug/feature has to be fixed and then i will recommend to James to release. |
v. 1.4.1 released |
resolve node native module error. Module not found: Error: Can't resolve 'module' in '/electron/node_modules/fflate/esm' ENVElectron: |
Thank you for submitting an issue to jsPDF. Please read carefully.
Are you using the latest version of jsPDF?
The issue occurs after upgrading from 1.3.5 to 1.4.0 (npm version). My project uses Webpack to build a bundle.
Have you tried using jspdf.debug.js?
I did. the error occurs on line 5387:14-27 (
var fs = require('fs');
)Steps to reproduce
It happens when I use webpack to build my project
Ideally a link too. Try fork this http://jsbin.com/rilace/edit?html,js,output
What I saw
What I expected
Expected webpack to complete without error as it did in v1.3.5
The text was updated successfully, but these errors were encountered: