847 questions
2
votes
1
answer
58
views
Webpack build suddenly failing because of `react-dev-utils` [closed]
I am suddenly unable to build my Webpack frontend, I randomly began getting this error despite not making any changes to the code:
Starting the development server...
/home/username/Documents/frontend/...
0
votes
0
answers
43
views
webpack file doesn't refer node_modules present in the imported path , but refer for it its node_modules
I am webpacking a module from pathA, node_modules are ignored.
I import the pathA/index.js in pathB node index.js dynamically, which has the required node_modules.
But when I run pathB node index.js, ...
1
vote
0
answers
251
views
Zustand store shared via Module Federation only provides initial value in remote app
I'm building a micro-frontend architecture using Webpack Module Federation. I have a host app and a remote app (cart), and I'm trying to share a global Zustand store (themeStore) from the host to the ...
-1
votes
1
answer
71
views
Excluding package using externals causes "Cannot use 'in' operator to search for 'core' in undefined" error
I am creating a razor class library that wraps the azure-maps-control npm package.
I use TypeScript to build the *.js and Webpack to bundle the *.js.
When I use the RCL in my Blazor web app it works ...
0
votes
0
answers
71
views
Host app loads empty remoteEntry with Webpack module federation plugin
Since a couple of days I am struggling with an issue with my module federation setup with webpack.
What I am trying to achieve is having dynamic remotes so that I can decide at runtime, in my layout....
1
vote
1
answer
44
views
Spine2D Atlas 404 Error in Phaser with Webpack 5
When I try to load Spine2D's atlas in Phaser, using Webpack 5, I receive 404 for the skeleton.png asset.
// File: skeleton.atlas
skeleton.png
size:2046,1890
filter:Linear,Linear
...
Spine2D's atlas ...
0
votes
0
answers
41
views
Webpack not exposing all the package.json dependencies in the generated library ( browser code )
I have a webpack config to bundle all the node_modules dependencies mentioned in the package.json file. The following config file generates a library which exposes only the last mentioned in ...
2
votes
0
answers
32
views
Unusual Gulp Task Behaviour
I am struggling with a Gulp Task and what it is doing.
Let me start with the first task:
gulp.task('html-template:join', (cb) => {
gulp.src('./src/template-data/**/*.json')
.pipe(...
0
votes
0
answers
31
views
How to import Stream.Transform in Webpack >5?
I have a project with dependencies that rely on node.js type libraries, like Buffer and Stream.
I have added the following to Webpack config:
cfg.resolve.fallback = {
...cfg.resolve....
1
vote
1
answer
253
views
CSS files have a lot of unwanted code after running npm run build
I have created Webpack 5 demo for plain HTML, CSS and JS using TailwindCSS v4.
GitHub: sanketpbhamre/tailwind-4-webpack-5
Webpack CSS configuration
module: {
rules: [
{
test: /\.(s[ac]|c)...
0
votes
0
answers
210
views
How to configure Webpack in Next.js to avoid chunk duplication for shared files?
I have a problem with the way webpack bundles my files.
Consider the following files:
// utils/index.js
export const funcA = () => {
return "funcA in CompA";
};
export const funcB = ()...
0
votes
1
answer
230
views
webpack-dev-server WebSocket error: read ECONNRESET at TCP.onStreamRead
I'm facing this problem for a websocket proxy ws/**:
<i> [webpack-dev-server] [HPM] Upgrading to WebSocket
<e> [webpack-dev-server] [HPM] WebSocket error: Error: read ECONNRESET
<e> ...
0
votes
0
answers
100
views
How can I dynamically load Webpack 5 split chunks on demand?
I’m using Webpack 5’s splitChunks to optimize my bundles and load them on demand. Here’s the general setup in my Webpack configuration:
optimization: {
splitChunks: {
chunks: 'all',
...
0
votes
0
answers
7
views
Containerized Webpack setup is not responding to file changes from mounted volume
I have a setup in which the changes of files in mounted volume is not being caught by Webpack. I have checked inside the container and the changes are happening to the file but Webpack is not catching ...
0
votes
0
answers
43
views
How to move split chunk into entry
do you know how to move common chunks to an entry point? Previously in webpack-4 you could have the same name for the entry point and for the common chunk. But in webpack-5 I have such error:
ERROR in ...
0
votes
0
answers
67
views
Using Webpack Module Federation with "react": "^18.3.1", host and client face ScriptExternalLoadError:
While loading the host application I'm facing issue with the webpack module federation with the error "Initialization of sharing external failed: ScriptExternalLoadError: Loading script failed.&...
0
votes
1
answer
52
views
Webpack 5 hot reload from different port (seperate application using the build)
The issue I'm stuck on is hot reload is trying to go to localhost:8000/build (where the application build is being used)
instead of localhost:3000/build which is the webpack-dev-server build location.
...
1
vote
2
answers
52
views
Extract css per entry point in webpack
Anyway to tell webpack in a project with multiple entries to include only respective css for each entry?
Seems like it extracts all css across all entries, puts them under vendor.css and includes that ...
2
votes
0
answers
174
views
Angular and Webpack keep throwing exception on invalid CSS comment syntax
I am building an Angular app, and I use npm run ng serve to build it. I use the latest Webpack 5+, and keep getting errors about my CSS files:
Build at: 2024-11-17T02:48:50.801Z - Hash: ...
0
votes
1
answer
58
views
Despite loading core-js & regenerator-runtime I still can't get async/await to work for my JavaScript with WebPack
An async/await call doesn't work. I loaded core-js and regenerator-runtime to fix that but it still isn't working. I'm guessing it's a matter of the proper components. That's why I posted my ...
1
vote
2
answers
1k
views
Webpack 5 Module Federation - Shared library issue
I have an npm module which I'd like to share between my host and remote apps, but when I'm debugging the app, it is obvious that for example a singleton class (from the npm module) is instantiated ...
0
votes
0
answers
84
views
React (TypeScript) - Unable to Use Process Environment
I am working on building my first React application (using TypeScript), however I am running into an issue building the application while trying to use environment variables. My folder structure is:
...
0
votes
1
answer
110
views
How to pass requested headers with webpack5 proxy?
I have a reactjs app with webpack5. There is a CORS problem. I use webpack devServer with proxy. But the main problem is webpack proxy doesn't pass original headers which is needed for authorization.
...
0
votes
1
answer
44
views
Image won't load in webpack build
slider.js
...
const initialize = (pImages) => {
pImages.forEach((image) => {
const sliderItem = document.createElement("img");
sliderItem.src = image.src; // this line result ...
0
votes
1
answer
607
views
Webpack v5 - Can't disable chunks
I have multiple entry points in my webpack config and I want each entry point to bundle into its own folder with nothing
import path from 'path';
import webpack from 'webpack';
import TerserPlugin ...