Skip to content
Advertisement

Tag: webpack

Webpack Error – configuration.node has an unknown property ‘fs’

I have encountered an error when using the latest version of Webpack (5.1.0). It looks like the configuration is throwing an error because the validation schema is too restrictive. Here is my webpack configuration file in a gist, and the error message I am seeing. Webpack.config.js https://gist.github.com/adarshbhat/3ec5950b66b78102da0cf46e51a3d633 Error I am attempting to use a parser generator library (antlr4) that works

Error: Cannot find module – webpack-dev-server.js

I am building a react app from scratch. Usually, I am running the npm create-react-app and it generates everything for you. I am following this tutorial https://www.youtube.com/watch?v=deyxI-6C2u4&ab_channel=TraversyMedia and it has the GitHub repository in the description. The problem is – when i run “npm start” it should run this command which is written here in the package.json The command works

Webpack custom library undefined after compile

I am building a javascript library and try to compile it with webpack. My problem is the library I build are not defined. I can see my code are in the webpack output file but at run time my library returned undefined. If I use my library uncompiled (without Webpack), then everything is working fine. This is my library: webpack.config.js:

How to specify a different path AND filename for each entry point in your webpack config? (my config is invalid despite following the docs)

I want to be able to have a specific path AND filename for each entry in my webpack config. Specifically, this example from the webpack “Output Filename” documentation is what I want: And here is my implementation of that example: I know that this kind of entry point config is valid because its in the “Output Filename” section of the

Can’t use a variable in require() in React

I am using the source of an image through a variable array. I tried the variable and with the backticks as well but it is giving me error that Error: Cannot find module ‘../../images/sectors/pellet-mill.png’. If I am using the source url only it works fine. Why can’t we use the variable in require()?? Answer Webpack can only bundle resources that

Advertisement