Questions tagged [webpack-5]

Use this tag for questions specific to features in Webpack 5. When using this tag, also include the more generic [webpack] tag where possible.

Use this tag for questions specific to features in Webpack 5. For general Webpack questions, the correct tag is .

Webpack 5

Migrating instructions can be found in the documentation.

862 questions
8
votes
1 answer

Uncaught ChunkLoadError: Loading chunk | Module Federation webpack 5 while loading CDN module

Implemented Module Federation for Host and Remote Application. For the Remote application, federated module is uploaded on a CDN. While accessing the federated module on localhost, Host application is working fine but while accessing the module…
Ghost
  • 111
  • 1
  • 3
8
votes
2 answers

Angular 12 upgrade issue : You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file

I have upgraded from Agular 11 to 12 getting below error for each SVG file. Error: Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. SVG…
ash
  • 81
  • 1
  • 3
8
votes
1 answer

Webpack 5 asset modules issue with woff file

We have recently migrated from webpack 4 to 5 and I discovered something that might be a bug or my lack of understanding. Basically, my project has several pages that I define as entry points in webpack.config.js. One of those entry points is called…
Lukich
  • 686
  • 1
  • 10
  • 20
8
votes
0 answers

Automatic publicPath is not supported in this browser

In a Electron-React-Typescript app I'm getting this error: Automatic publicPath is not supported in this browser devDependencies in package.json : "css-minimizer-webpack-plugin": "^1.2.0", "electron": "^11.2.3", "typescript": "^4.1.5", "webpack":…
Raphael10
  • 2,508
  • 7
  • 22
  • 50
8
votes
1 answer

WP5 Module Federation: Singleton instantiated multiple times

Unfortunately, my repro for this is in a complex proprietary project, so I will do my best to explain what is going on. The closest example project to my use-case is this one:…
csvan
  • 8,782
  • 12
  • 48
  • 91
8
votes
1 answer

How to correctly expose jQuery with Webpack 5?

Is there any specific way to expose jQuery with Webpack 5? It used to work on Webpack 4 OK, with the config bellow, but it shows the Uncaught Reference Error: jQuery is not defined error now with 5. module: { rules: [ { test:…
idm
  • 189
  • 1
  • 11
7
votes
1 answer

Module Federation, React, and Apollo 3 warnings

I'm building an app with micro-frontends using webpack 5's module federation plugin. Everything was fine until I started adding react hooks into my remote app. At that point I received errors about "invalid usage of hooks", i.e. I discovered I had…
7
votes
1 answer

Error importing CSS modules with Storybook webpack 5

I am using Storybook with webpack 5 for a simple project and I'm having challenges with CSS module imports despite customising the webpack config for storybook. (2:7) src/stories/header.css Unknown word 1 | > 2 | import API from…
Ikem O
  • 79
  • 1
  • 4
7
votes
1 answer

ScriptExternalLoadError: Loading script failed

I am getting this error message :ScriptExternalLoadError: Loading script failed. (missing: http://localhost:3005/remoteEntry.js). when trying to load a remote app from the container app in development. I have this optimization (when I put them in…
Ron
  • 71
  • 1
  • 4
7
votes
0 answers

webpack 5 migration - dev server - 404 error - Cannot GET "/"

I have a legacy React app which is should be updated from 16 to 17, webpack from v3 to v5 and babel. I had followed the offical webpack migration guides for deprecated plugins and configurations. However I cannot run the app on local server. The…
7
votes
3 answers

I'm having this weird webpack.cache.PackageCacheStrategy

Below is the error on my console $ next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Using webpack 5. Reason: no custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5 warn - You…
Jeffrey Agregado
  • 71
  • 1
  • 1
  • 2
7
votes
2 answers

Module parse failed: Unexpected character '�' After updating to angular 12

After upgrading Angular from v.11 to v.12 I am getting the following Error home.Component.ts imgname= require("../assets/images/imgname.png"); ./src/assets/images/imgname.png:1:0 - Error: Module parse failed: Unexpected character '�' (1:0) You may…
Vignesh
  • 2,378
  • 3
  • 25
  • 48
7
votes
0 answers

--watch not working after updateing from webpack 4 to 5

I have been migrating a project from Webpack 4 up to 5 and have hit a snag. The --watch option is no longer working with my configuration, and I've tried everything I can find. const webpack = require('webpack'); const path = require('path'); const…
7
votes
1 answer

Webpack 5 and null-loader-esque functionality

Webpack 5 deprecated null-loader, which was helpful for excluding certain imports from client-side bundles. Now, the docs say that I should use the resolve.alias option with false instead, however, this thing doesn't accept regex keys like…
DavidsKanal
  • 655
  • 11
  • 15
7
votes
3 answers

Error: Prevent writing to file that only differs in casing or query string from already written file. reactjs laravel

I am working on a laravel reactjs project and when I run the command npm run dev the compilation stuck at 95% and give the following error. I checked in the whole project there is no file calling with the case-sensitive names all images are calling…
Varinder Sohal
  • 1,142
  • 5
  • 24
  • 44
1 2
3
57 58