All Questions

Tagged with
Filter by
Sorted by
Tagged with
2225 votes
67 answers
2.8m views

Error message "error:0308010C:digital envelope routines::unsupported"

I created the default IntelliJ IDEA React project and got this: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (...
a1cd's user avatar
  • 22.9k
424 votes
37 answers
616k views

How to Polyfill node core modules in webpack 5

webpack 5 no longer do auto-polyfilling for node core modules. How to fix it please? BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer ...
Saber's user avatar
  • 4,331
271 votes
14 answers
287k views

How to build minified and uncompressed bundle with webpack?

Here's my webpack.config.js var webpack = require("webpack"); module.exports = { entry: "./entry.js", devtool: "source-map", output: { path: "./dist", filename: "bundle.min.js" }, ...
Mulan's user avatar
  • 132k
239 votes
14 answers
381k views

How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

I am new to the whole nodejs/reactjs world so apologies if my question sounds silly. I am currently playing around with reactabular.js. Whenever I do a npm start it always runs on localhost:8080. How ...
90abyss's user avatar
  • 7,219
236 votes
25 answers
481k views

Error: Cannot find module 'webpack'

I'm just getting started with webpack and am having difficulty getting the multiple-entry-points sample to build. The webpack.config.js file in the example includes the line var CommonsChunkPlugin =...
Ed.'s user avatar
  • 6,042
184 votes
8 answers
158k views

How to get access to webpack-dev-server from devices in local network?

There is some webpack dev server config (it's part of the whole config): config.devServer = { contentBase: './' + (options.publicFolder ? options.publicFolder : 'public'), stats: { modules: ...
malcoauri's user avatar
  • 12.1k
169 votes
5 answers
73k views

Gulp + Webpack or JUST Webpack?

I see people using gulp with webpack. But then I read webpack can replace gulp? I'm completely confused here...can someone explain? UPDATE in the end I started with gulp. I was new to modern front-...
PositiveGuy's user avatar
  • 19.1k
164 votes
15 answers
220k views

Conflict: Multiple assets emit to the same filename

I'm a webpack rookie who wants to learn all about it. I came across a conflict when running my webpack telling me: ERROR in chunk html [entry] app.js Conflict: Multiple assets emit to the same ...
Andreasrein's user avatar
  • 1,685
163 votes
15 answers
397k views

npx command not found

I am working with webpack and I need to execute ./node_modules/webpack/bin/webpack.js using npx. npx webpack would run the webpack binary (./node_modules/webpack/bin/webpack), but each time I execute ...
wokoro douye samuel's user avatar
140 votes
12 answers
237k views

Webpack - webpack-dev-server: command not found

I am working on a React webapp using webpack, loosely alongside this tutorial. Accidentally, I added the node_modules folder to my git. I then removed it again using git rm -f node_modules/*. Now, ...
Jonas Kemper's user avatar
  • 3,855
137 votes
15 answers
141k views

How to uninstall global package with npm?

I have installed webpack in this way: npm install -g webpack Now want to uninstall it: npm uninstall -g webpack Check it again, it didn't been uninstalled: webpack -v 3.1.0 Why? And, I use this ...
cloud_cloud's user avatar
  • 2,071
134 votes
8 answers
263k views

How to determine the installed webpack version

Especially during the transition from webpack v1 to v2, it would be important to programmatically determine what webpack version is installed, but I cannot seem to find the appropriate API.
doberkofler's user avatar
  • 9,975
128 votes
10 answers
177k views

Webpack 4 "size exceeds the recommended limit (244 KiB)"

I have two files which are combined under 600 bytes (.6kb) as below. So how is it that my app.bundle.js is so large (987kb) and more importantly how does one manage the size of it? src file index.js ...
Michael Nelles's user avatar
124 votes
17 answers
195k views

Add Favicon with React and Webpack

I am attempting to add a favicon to a React-based website that I made using webpack. It has been a total nightmare to add a favicon and I have tried many solutions to no avail. The latest solution ...
CodeYogi's user avatar
  • 1,399
122 votes
8 answers
237k views

Webpack how to build production code and how to use it

I am very new to webpack, I found that in production build we can able to reduce the size of overall code. Currently webpack builds around 8MB files and main.js around 5MB. How to reduce the size of ...
Gilson PJ's user avatar
  • 3,511
117 votes
2 answers
39k views

Webpack vs webpack-dev-server vs webpack-dev-middleware vs webpack-hot-middleware vs etc

I'm starting working with webpack with a node/express environment developing a ReactJS server side rendered application with react-router. I'm getting very confused about the role of each webpack ...
Mendes's user avatar
  • 18k
114 votes
14 answers
189k views

Cannot find module '@babel/core'

I am following along with this webpack4/react tutorial: https://www.youtube.com/watch?v=deyxI-6C2u4 I have followed it exactly up until the part where he runs npm start. The difference is, his app ...
J. Doe's user avatar
  • 1,207
109 votes
9 answers
100k views

How to set multiple file entry and output in project with webpack?

How to set multiple file entry/output in project with webpack? I follow http://webpack.github.io/docs/tutorials/getting-started/ success compile if only one file in one entry/output... directory ...
user1775888's user avatar
  • 3,273
109 votes
4 answers
51k views

Webpack-dev-server serves a directory list instead of the app page

I can only see the actual app under /public. The configs in webpack.config.js are below: var path = require('path'); var webpack = require('webpack'); module.exports = { entry: [ 'webpack-...
Jason Lam's user avatar
  • 1,372
108 votes
14 answers
186k views

Webpack: Bundle.js - Uncaught ReferenceError: process is not defined

Here's my webpack.config.js "use strict"; module.exports = { entry: ['./main.js'], output: { path: __dirname, filename: 'bundle.js' }, module: { loaders: [ { ...
cbll's user avatar
  • 6,879
107 votes
9 answers
101k views

Babel 7 - ReferenceError: regeneratorRuntime is not defined

I have an application that is a node backend and a react frontend. I get the following error when i try to build/run my node application. Node: v10.13.0 Error: dist/index.js:314 ...
Kay's user avatar
  • 19k
94 votes
15 answers
189k views

Uncaught ReferenceError: Buffer is not defined

Our application kept showing the error in the title. The problem is very likely related to Webpack 5 polyfill and after going through a couple of solutions: Setting fallback + install with npm ...
whileone's user avatar
  • 2,645
94 votes
10 answers
196k views

Node cannot find module "fs" when using webpack

I'm using node.js and webpack to create a bundle. From what I've read, node.js should contain fs module for managing files. However when I call require("fs") I get an Cannot find module "fs" error. ...
user3799968's user avatar
  • 1,137
94 votes
3 answers
63k views

Webpack for back-end?

I was just wondering, I started using Webpack for a new project and so far it's working fine. I almost would say I like it better than Grunt, which I used before. But now I'm quite confused how and or ...
Erik van de Ven's user avatar
92 votes
10 answers
72k views

How do I load font-awesome using SCSS (SASS) in Webpack using relative paths?

I have font-awesome in my node_modules folder so I try to import it in my main .scss file like so: @import "../../node_modules/font-awesome/scss/font-awesome.scss"; But Webpack bundling compilation ...
Richard's user avatar
  • 15.9k
90 votes
8 answers
136k views

Webpack 4 - create vendor chunk

In a webpack 3 configuration I would use the code below to create separate vendor.js chunk: entry: { client: ['./client.js'], vendor: ['babel-polyfill', 'react', 'react-dom', 'redux'], }, ...
Tomasz Mularczyk's user avatar
85 votes
2 answers
86k views

ReferenceError: webpack is not defined

In my webpack app I have a basic build process that's triggered by "npm run build" which executes the webpack binary and copies my index.html in /app to /dist. Whenever I run npm run build I get ...
leaksterrr's user avatar
  • 3,870
85 votes
8 answers
235k views

webpack command not working

I am new to Node Js and Webpack. I tried to start a project with module-loaders. Firstly, I installed nodeJs and NPM and created a new directory called tutorial. I used the command prompt to cd into ...
Mohan's user avatar
  • 4,757
76 votes
6 answers
88k views

Running a node express server using webpack-dev-server

I'm using webpack to run my react frontend successfully using the following config: { name: 'client', entry: './scripts/main.js', output: { path: __dirname, filename: '...
Øyvind Bråthen's user avatar
75 votes
8 answers
58k views

path.js:1086 Error: ENOENT: no such file or directory, uv_cwd

I was following the Webpack guide and get stuck here while running npm run build I received the this error: path.js:1086 cwd = process.cwd(); ^ Error: ENOENT: no ...
Nedko Dimitrov's user avatar
75 votes
19 answers
146k views

How to fix "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" error

I'm trying to deploy a reactjs application to heroku. While compiling assets, the build fails and produces this error: -----> Ruby app detected -----> Compiling Ruby/Rails -----> Using Ruby ...
Hafsa Saleem's user avatar
74 votes
6 answers
75k views

Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' Require stack:

I have webpack-cli installed on my laravel project. I don't know why first of all we need it to run my vue app but this is causing an error: When I run npm run dev or npm run hot [webpack-cli] Error: ...
gjqeriqi's user avatar
  • 763
73 votes
2 answers
54k views

Using webpack with an existing PHP and JS project

I have an existing PHP project with jquery and bootstrap, not using any front-end framework. I am trying to use webpack module bundler in order to create a single entry point for my project resources,...
KAD's user avatar
  • 11k
71 votes
6 answers
105k views

How can I use webpack with express?

When I try to use webpack with a simple express server I always get TONS of errors: express.js 'use strict'; var express = require('express'); var path = require('path'); var url = require('url'); /...
SudoPlz's user avatar
  • 22.2k
67 votes
28 answers
115k views

proxy not working for react and node

I'm having issues with the proxy I set up. This is my root package.json file: "scripts": { "client": "cd client && yarn dev-server", "server": "nodemon server.js", "dev": "...
Strahinja Ajvaz's user avatar
67 votes
9 answers
74k views

An import path cannot end with '.ts' - NodeJS and Visual Code

I've got an error while trying to build a simple NodeJS app: Even that Visual Code prompts an error, my code got running.. When I remove the .ts extension from import statement, I got an error that ...
Guilherme Chiara's user avatar
66 votes
3 answers
37k views

Webpack sass where is the css file

I am using web pack with sass loader like this: module.exports = { module: { loaders: [ { test: /\.scss$/, loader: "style!css!sass" } ] } }; But i see the ...
user avatar
65 votes
9 answers
117k views

Load fonts with Webpack and font-face

I'm trying to load a font in my CSS file using @font-face but the font never loads. This is my directory structure. Then in webpack.config.js I have the loader to get fonts. var path = require('path'...
Ebenizer Pinedo's user avatar
64 votes
11 answers
79k views

Angular 6 many Can't resolve errors (crypto, fs, http, https, net, path, stream, tls, zlib)

I'm building an Angular 6 app, but every time I want to serve to localhost, I get these errors: ERROR in ./node_modules/aws-sign2/index.js Module not found: Error: Can't resolve 'crypto' in 'C:\...
Zizazorro's user avatar
  • 1,341
63 votes
6 answers
75k views

How to add wildcard mapping in entry of webpack

I need to webpack all the js file in the script folder.I tried this module.exports = { module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loaders: ["...
Praveen Raj's user avatar
  • 1,014
58 votes
6 answers
40k views

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 ...
redab's user avatar
  • 1,621
57 votes
4 answers
33k views

Get current `--mode` in webpack.config.js

How can I get the current --mode specified in package.json inside webpack.config.js? (For instance, for pushing some plugins.) package.json "scripts": { "dev": "webpack --...
xAoc's user avatar
  • 3,538
56 votes
14 answers
70k views

Karma/Jasmine times out without running tests

I'm trying to run Karma/Jasmine from Grunt on a project generated with http://newtriks.com/2013/12/31/automating-react-with-yeoman-and-grunt/ Karma launches PhantomJS (or Chrome) and, depending on ...
edoloughlin's user avatar
  • 5,831
56 votes
3 answers
113k views

webpack-dev-server Cannot find module 'webpack'

I'm trying to use webpack-dev-server to run a simple program but I'm getting this error: module.js:471 throw err; ^ Error: Cannot find module 'webpack' at Function.Module....
yonBav's user avatar
  • 1,805
55 votes
6 answers
43k views

Import from subfolder of npm package

I've been working on creating a small library of React components for use in several other projects. I am publishing the package internally (using a private GitHub repository) and then including in ...
Kendall's user avatar
  • 2,072
54 votes
2 answers
20k views

How should I use moment-timezone with webpack?

In using webpack to build my project, I typically require modules in CommonJS from npm modules. I need moment-timezone in my project, however in building the package you must also build all the data ...
jaredkwright's user avatar
  • 1,390
54 votes
1 answer
7k views

In the `import` syntax of ES6, how is a module evaluated exactly?

Let's say we have four modules, A, B,C and D In module A: console.log("A evaluated") function AClass { console.log("A constructor") } var aObj = new AClass() export default aObj; In module B: ...
Hanfei Sun's user avatar
  • 46.2k
53 votes
3 answers
54k views

Get Webpack not to bundle files

So right now I'm working with a prototype where we're using a combination between webpack (for building .tsx files and copying .html files) and webpack-dev-server for development serving. As you can ...
B. Blunt's user avatar
  • 607
51 votes
2 answers
46k views

webpack css-loader not finding images within url() reference in an external stylesheet

I'm new to the whole Node/NPM/Webpack world, so apologies if this is obvious. I'm attempting to build a simple front-end project bundled with Webpack. I've got node installed, and have a package.json ...
hairbo's user avatar
  • 3,123
50 votes
6 answers
22k views

Webpack TypeScript module.hot does not exist

I want to enable Webpack HMR in a NodeJS project written in TypeScript. But module.hot is not available: @types/webpack-env defines: declare var module: __WebpackModuleApi.Module Which conflicts ...
kube's user avatar
  • 13.6k

1
2 3 4 5
114