Skip to main content

All Questions

0 votes
0 answers
8 views

React project from Webpack to Vite

I'm moving my React project from Webpack to Vite, but I have some problems: File Extensions: My files end with .js, but Vite wants them to be .jsx. Node Version: My project uses Node 16.14.0, but Vite ...
-1 votes
0 answers
18 views

Webpack : Not getting desired folder tree of build files

I am working on an application and using Webpack to serve the build files. In the Chrome developer tools -> Sources, I am not getting the folder tree as expected. Here's the actual folder structure ...
7 votes
5 answers
18k views

Webpack 5 Receiving a Polyfill Error?!?! My JavaScript React project is receiving a polyfill error while trying to compile my webpack.config.js file

I am taking a course on Udemy (it is Brad Schiff's React for the Rest of Us course here) that is based on React and I am receiving an error related to webpack which is keeping it from compiling. I am ...
4 votes
3 answers
2k views

Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. "_assetEmittingPreviousFiles"

I am using webpack - v5.90.3, webpack-cli - v5.1.4, webpack-dev-server - v5.0.2 In my webpack.config.dev.js: const path = require('path'); const webpack = require('webpack'); module.exports = { ...
0 votes
1 answer
9k views

Webpack dev server hot reloading not working with reactjs, though i have done "inline:true"?

Why does Hot Module Replacement stop working on webpack dev server? My package.json file: { "name": "routing-react", "version": "1.0.0", "description": "Just a little ReactJS Training Ground", ...
0 votes
0 answers
21 views

Invalid hook call in react-redux provider

I am trying to migrate from Parcel 1.0 to Webpack 4, I am using React 16.14, Node: 18.20, Npm 10.7. Getting below error when running webpack serve Invalid hook call. Hooks can only be called inside of ...
1 vote
1 answer
36 views

Webpack configuration not working for jsx file with babel lorder

When runing the react project which is configured with webpack and babel loder is giving and error saying unexpected token in jsx files.Please find bellow error snippit ERROR in ./src/index.js 10:12 ...
6 votes
1 answer
11k views

Webpack-Dev-Server: Errors while compiling. Reload prevented. (Stack: React)

I use React with Webpack-Dev-Server for local Development. Every now and then I get this error: "react_devtools_backend.js:6 [WDS] Errors while compiling. Reload prevented." After the error occurs, ...
13 votes
5 answers
25k views

Webpack: process.env undefined using DefinePlugin and DotEnv

I would like to get my variable from my .env file but I always get undefined This is my js code : require('dotenv').config(); class Header extends React.Component{ constructor(props){...} ...
9 votes
5 answers
34k views

webpack options has an unknown property 'hotOnly'. Invalid options object. Dev Server has been initialized using an options object

I am running the command npx webpack-dev-server --mode development in my react application and getting the preceding error. [webpack-cli] Invalid options object. Dev Server has been initialized using ...
0 votes
0 answers
23 views

The webpack bundle created and stored in the project directory is different than the one used to run the application with webpack-dev-server

When I run the command npm run build (webpack), webpack builds a folder with all of the static files bundled together in bundle.js. Then, when I run the command npm run dev (webpack serve), it opens ...
17 votes
1 answer
18k views

React + Webpack HMR is refreshing the page (not hot loading)

I'm having a bit of trouble getting the react-hot webpack loader to work correctly. When I load the page I get the following as I would expect: [HMR] Waiting for update signal from WDS... [WDS] ...
0 votes
1 answer
46 views

Webpack - Typescript aliases error in production mode only

I'm having a problem with a React project configured with Webpack and using Typescript. Containerized with Docker (CI/CD with gitlab) . Before we didn't use aliases on our project and builds in ...
4 votes
3 answers
31k views

React Module Federation - Uncaught Error: Shared module is not available for eager consumption: webpack/sharing/consume/default/react/react

I am trying react module federation. I have created two react apps(modulefederation1, modulefederation2) using create-react-app command. I am getting 'Uncaught Error: Shared module is not available ...
1 vote
0 answers
78 views

ModuleFederation with react - not able to load multiple remotes into main

I am trying to learn microfrontend with reacts using modeuleFederation but facing an issue. I have 3 projects inside my director which are like main - running on port 8080 remote 1 (products) - ...

15 30 50 per page
1
2 3 4 5
48