Skip to content

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

Open

Description

@martixy

Node v13.8.0
css@2.2.4
webpack@4.43.0

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

Activity

  1. praveen0202-zz commented on Jul 1, 2020

    @praveen0202-zz

    Im also facing same issue

  2. jkeen commented on Jul 21, 2020

    @jkeen

    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.

  3. satelllte commented on Jul 27, 2020

    @satelllte

    Having the same issue on css@3.0.0

  4. FatalIdiot commented on Aug 18, 2020

    @FatalIdiot

    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.

  5. flyFatSeal commented on Sep 4, 2020

    @flyFatSeal

    Can anyone help?

  6. YunFeng0817 commented on Sep 9, 2020

    @YunFeng0817

    add the following code to the webpack.config.js

    node: {
            fs: "empty"
    }

    It works for me.

  7. added a commit that references this issue on Oct 25, 2020
  8. IanGrainger commented on Oct 25, 2020

    @IanGrainger

    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

  9. Fi1osof commented on Dec 8, 2020

    @Fi1osof

    Possible solution: #146 (comment)

  10. holblin commented on May 26, 2022

    @holblin

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions