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

Webpack is unsupported? #21

Open
j0hnm4r5 opened this issue Mar 6, 2018 · 3 comments
Open

Webpack is unsupported? #21

j0hnm4r5 opened this issue Mar 6, 2018 · 3 comments

Comments

@j0hnm4r5
Copy link

j0hnm4r5 commented Mar 6, 2018

When trying to use control-panel with Webpack, I get:

Uncaught Error: Cannot find module "fs"

and

./node_modules/control-panel/index.js Module not found: Error: Can't resolve 'fs' in '$PATH_TO_PROJECT/node_modules/control-panel'.

This seems to be a known problem with other repos (see here, for example), but the solutions provided for those repos (namely, adding node: { fs: "empty: } to the webpack.config.js) do not seem to work — trying that results in a new error: Uncaught TypeError: fs.readFileSync is not a function.

Following up on that error leads to information that fs.readFileSync will never truly work in the browser, as it is a Node function (see here).

@caracal7
Copy link

the same issue

@caracal7
Copy link

I found solution

npm i -D transform-loader

and inside webpack.config.js

rules : [
{
test: /node_modules/(control-panel)/,
loader: 'transform-loader?brfs',
}
]

@ghost
Copy link

ghost commented Aug 16, 2018

I had a little trouble with this solution (I'm on webpack ^4.16.5), but I did get it working with what's in #23

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

2 participants