Skip to content
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

Can't resolve 'fs' in '.\node_modules\css\lib\stringify' when building #139

Open
martixy opened this issue Jun 22, 2020 · 9 comments
Open

Comments

@martixy
Copy link

martixy commented Jun 22, 2020

Node v13.8.0
[email protected]
[email protected]

I receive the following error when building with this package:

ERROR in ./node_modules/css/lib/stringify/source-map-support.js
Module not found: Error: Can't resolve 'fs' in '[...]\node_modules\css\lib\stringify'
 @ ./node_modules/css/lib/stringify/source-map-support.js 10:9-22
 @ ./node_modules/css/lib/stringify/index.js
 @ ./node_modules/css/index.js
@praveen0202-zz
Copy link

Im also facing same issue

@jkeen
Copy link

jkeen commented Jul 21, 2020

Looks like it works in Node 10.x, but not 12.x+

Haven't tested 11.x

EDIT: nevermind, I'm also having this problem.

@satelllte
Copy link

Having the same issue on [email protected]

@FatalIdiot
Copy link

Seems like "fs" package is no longer present in NPM and when trying to install it just downloads README and package.json files, no actual package.

@flyFatSeal
Copy link

Can anyone help?

@YunFeng0817
Copy link

add the following code to the webpack.config.js

node: {
        fs: "empty"
}

It works for me.

IanGrainger added a commit to IanGrainger/css that referenced this issue Oct 25, 2020
@IanGrainger
Copy link

I'm getting this error trying to use a dependent package in the browser. Please can you try / catch loading of fs? Then it'll be fine as long as we don't need sourcemap support (which I don't!)

PR here: #146

@Fi1osof
Copy link

Fi1osof commented Dec 8, 2020

Possible solution: #146 (comment)

@holblin
Copy link

holblin commented May 26, 2022

I worked on removing the source-map support. This will solve the issue. Trying to reach out to the rework members before going into the fork route (and discussing with my company for the PR route).
ref: #164

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

No branches or pull requests

10 participants