Questions tagged [webpack]
Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it can also transform, bundle, or package just about any resource or asset. Webpack takes modules with dependencies and generates static assets representing those modules. Webpack enables extensibility and promotes best practices in web architecture and performance.
webpack
42,782
questions
0
votes
0
answers
11
views
SVG Icons don't show after compiling / bundling with Webpack
This is my first time building a web-application, and I'm in my final steps. I'm trying to bundle the whole project with webpack, and everything seems to work, except for my SVG-Icons.
I think the ...
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 ...
0
votes
0
answers
7
views
Webpack-dev-server serves a directory list instead of the app page on webpack 5
I have looked at various solutions to this but none of them works for me, feel free to ask for more details
const webpack = require("webpack");
const webpackDevServer = require("webpack-...
0
votes
0
answers
6
views
Use hash in remote module URL for webpack module federated components
I have a app that loads some module federated components. For example:
module.exports = {
plugins: [
new ModuleFederationPlugin({
name: 'app',
remotes: {
remoteComponent1:'...
0
votes
0
answers
14
views
`tsc` to produce CommonJS and ESM versions of my typescript library
I am quite new to JavaScript/Typescript in general and to JavaScript modules in particular.
I know there is tons of materials about my question in the web, but after reading for two days I feel I find ...
0
votes
0
answers
7
views
Rendering webpack bundled is code on html
I have compiled react component into a js bundle using webpack. Importing this into other react projects works just fine.
Is there any way to render this js file on a normal html file, without using ...
0
votes
0
answers
15
views
Webpack complied with 1 error when i try to npm run dev [closed]
I am doing a course on javaScript in udemy. It is first time i am using things like webpack and babel , in my final step of project setting when i try to do npm run dev . I get this error
C:\Users\...
1
vote
0
answers
23
views
Error with nativescript compilation due to gradle version change?
I have a nativescript project that is built through jenkins.
Up until July 9th, the project built without any issues. On that same day, and after a commit, the build stopped working.
To make sure that ...
0
votes
1
answer
23
views
Audio key "stretchAudio" missing from cache in phaser 3
I tried adding audio in my game but when I call that audio using this.sound.add('') it encountered an error 'missing from cache'
//preload scene
preload () {
this.load.audio('stretchAudio', './...
0
votes
0
answers
18
views
How to build from webpack 4 to without breaking Content-Security-Policy of not using 'unsafe-eval'?
I'm trying to build through webpack 4 & npm . i facing issue of "EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the ...
0
votes
0
answers
9
views
Trying to use dotenv or config in react app and getting: webpack < 5 used to include polyfills error, tried creating webpack config, doesn't work
i'm getting this error below trying to use both dotenv and config. I've got a Typescript React App, just installed and need to use environment variables.
I don't have webpack installed as a dependency ...
2
votes
0
answers
38
views
lodash-es vs lodash bundle size comparison
There's a project I'm currently working on which uses regular lodash library. For now we use 3 util functions cloneDeep, isEmpty, and get.
Currently import statements are like so import util from '...
0
votes
0
answers
18
views
How Can I Fix Missing WebP Images in Production Build with CRACO Configuration?
I'm working on a React project using Craco to manage Webpack configurations. My goal is to use WebP images for better performance, falling back to PNGs if WebP is not supported. I've already converted ...
0
votes
0
answers
38
views
Webpack 5 and SVG parameters
I updated to Webpack 5 and found out that url-loader is deprecated in favor of asset modules. I can load SVG's like so:
{
test: /\.svg(\?.*)?$/,
exclude: [path.resolve(...
0
votes
0
answers
11
views
How to use relative paths in SCSS URLs which work for Angular application and karma builds
I've migrated a project to Angular 18 using @angular-devkit/build-angular:application as builder. During the migration process all relative paths in SCSS image URLs have been changed from "~/src/...
0
votes
0
answers
39
views
Module not found / build failed in my yarn workspaces monorepo
I am combining my React web application with my Expo React Native mobile app into a monorepo using yarn workspaces because they both need to share some utils, queries, etc. My file structure is ...
0
votes
0
answers
13
views
VS Code firefox-debug unable to hit breakpoints for angular app (docker)
I am running:
ubuntu 24.04
VS Code installed, with firefox-debug extension
Docker compose my web app
I can launch a browser hosting my web app from VS Code, but I am not able to hit any breakpoints. ...
0
votes
0
answers
31
views
(Firebase App hosting) Error: Only the Angular application builder is supported
I'm working on an Angular project where I need to use environment variables managed by dotenv. For this, I've been using the custom webpack builder provided by @angular-builders/custom-webpack:browser....
0
votes
0
answers
18
views
VS Code/Chrome Debugger Causes Breakpoint in Angular Application Generated Webpack File
I have an angular application that I work with using VS Code and Chrome running with the debugger port set to 9222. However, the debugger likes to throw its own breakpoints into the webpack-generated ...
0
votes
0
answers
10
views
How to fix chaining loader issue
This is the error I am facing -
common_app.chunk.js:158268 ./node_modules/@netless/synced-store/node_modules/value-enhancer/dist/index.js 27:29
Module parse failed: Unexpected token (27:29)
You may ...
0
votes
1
answer
22
views
Error running webpack after adding typescript to existing JS project
I'm having difficulty incorporating Typescript to my JS project which uses webpack. Here is my webpack.config.js:
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
const ...
0
votes
0
answers
17
views
using CSS-Loader, Style-Loader with ngtools is generating TypeError: at ShadowCss.shimCssText (compiler.mjs)
`I am creating Angular V-18 project without CLI and but i cannot find the solution for this one
my package.json
my tsconfig.json
webpack.config.mjs
const __filename = fileURLToPath(import.meta.url); ...
0
votes
0
answers
20
views
Deployment crashes when building with new image
I have an react, typescript and webpack application deployed using cloudflare pages. On the last modification I tried adding a new image on my page but the deployment fails to find that particular ...
0
votes
0
answers
40
views
Appropriate loader to handle this file type .mjs | webpack
I recently added @radix-ui/react-navigation-menu to my project. However, upon attempting to rebuild, I encountered the following error message: the error..
Interestingly, other components from the ...
1
vote
0
answers
20
views
Webpack Duplicate Image File Issue and 404 Error with React App
I am working on a React project with Webpack to bundle my assets. My issue is that Webpack is creating duplicate image files in the dist/images directory, and my application is also encountering a 404 ...
0
votes
1
answer
26
views
Avoid url resolution in scss files in Angular
I did a css -> scss migration on an existing Angular project using schematics-scss-migrate. Everything works fine except the URL's, if any, in scss files. So I found out that in scss files the URL'...
0
votes
0
answers
17
views
Webpack dynamic import in node.js app doesn't work: MODULE_NOT_FOUND
I am trying to import a js file at runtime:
const migrationsDir = path.resolve(__dirname, '../migrations/tenanted');
import(path.join(migrationsDir, '1681831306977-initial-schema.js'))
.then(() =>...
0
votes
0
answers
14
views
Can't run TypeOrm migrations with webpack: MODULE_NOT_FOUND
I have node.js app built with webpack. I am following this FAQ
My webpack config has one entrypoint for the migrator script, and multiple entrypoints for migration files:
const commonConfig = require('...
1
vote
1
answer
46
views
+50
Problem when requiring packages bundled with webpack
I'm able to use libraries with node like:
const API = require("api");
const Service = require("service");
however, when I bundle the js file with webpack, it doesn't work and I ...
0
votes
0
answers
22
views
Build failed in Storybook webpack config caused by svg
this error occurs when launching storybook, all svg that i use in the application cause an error
in ./src/shared/assets/icons/about-20-20.svg ...etc
Module build failed (from ./node_modules/@svgr/...
0
votes
0
answers
11
views
Can't resolve './zstd.win32-x64-msvc.node' in ...node_modules/@mongodb-js/zstd
I have a react node js typescript project I'm working on via my m2 chip mac where I'm trying to get MongoDB and mongoose setup on.
I've installed the basic mongodb package via npm and am getting the ...
0
votes
0
answers
13
views
NativeScript services error when try use a axios or other webservice library. webpack errors
I create a simple android hello-world project (nativescript angular) latest or v17 and it run normal, then I install axios npm i axios if I try a simples get a lot errors happens. I installed some ...
0
votes
0
answers
12
views
Typescript import cannot resolve path to node_module
I am working on a typescript project, trying to import 'path'.
It's for a Figma plug-in so I followed their getting started guide (https://www.figma.com/plugin-docs/libraries-and-bundling/#bundling-...
-1
votes
0
answers
21
views
Error: webpack < 5 used to include polyfills for Node.js core modules by default [closed]
Before we are using Node.js version 16.17.0 in React.js project
and now want to to upgrade in latest Node.js LTS version which is 20.15.1, but there is an issue. How can I fix this?
ERROR in ./...
0
votes
1
answer
32
views
Angular - Esbuild chunk sizes do not match build output when served
I recently switched my Angular app to v18 and moved from webpack to esbuild. However, when comparing my chunk sizes with code splitting, I see the sizes do not make sense.
When using webpack, my ...
0
votes
1
answer
16
views
Browser not calling the entry point in react bundle.js
I have a relatively simple react app that has been working fine for the past few months in production.
After converting it from JavaScript to TypeScript, the main function (entry point) doesn't even ...
0
votes
1
answer
41
views
Confusion about javascript modules and webpack: The requested module ... does not provide an export named 'default'
I am trying to set up webpack in our javascript project and we want to write new javascript es6 classes, bundle them via webpack and then reuse the packages. I set up a simple example where i define a ...
0
votes
0
answers
6
views
Webpack bundling with shared dependencies and no extra bundle
Is it possible to have two bundles that import the same dependency but don't cause code duplication without having to add a script tag for a bundle like shared.bundle.js?
For example:
entry1 // ...
0
votes
0
answers
25
views
React compiler, how to setup with craco/webpack
I migration in 18 to 19 react today.
Read documentation, installed packages babel-plugin-react-compiler , for eslint eslint-plugin-react-compiler.
I'm not that good at setting up webpack, but from the ...
0
votes
1
answer
46
views
How do I trace errors in Next.js?
Error tracing is quite difficult in Next since it shows the path of the file in the build folder, how can I trace back to where the error originally occurred in my project folder structure?
I have ...
1
vote
1
answer
45
views
Angular 17 ESBuild Configuration for environment variables
Just migrated from Angular 15 to the 17. And currently it is possible to build and serve with esbuild instead of webpack. With webpack there was a way use a custom webpack config for things like, ...
0
votes
0
answers
34
views
Uncaught runtime errors: ERROR process is not defined
My npm start has about 58 errors, almost all of them in webpack.config.js. Now, when I stop Ctrl-C and restart (npm start), my browser shows the pictures below. I've stopped and restarted my back end ...
0
votes
0
answers
13
views
React build config image path css
My config works with "react-scripts": "3.4.3" and refuses to work with "react-scripts": "5.0.1". When building it gives the following error
module.rules[2]....
-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 ...
0
votes
1
answer
35
views
Webpack React Router DOM build issue
I have a React+Typescript app with Webpack 5 configuration that was built from scratch. For routing I use React Router DOM 6.23.1. In development mode routing works as expected, but after I build the ...
0
votes
0
answers
34
views
JScript module export not recognized using Webpack & Typescript
Problem
I have a function named index declared with export in a Jscript file, when trying to use it I get an error message telling "does not provide an export named 'index'"
This is a long ...
-1
votes
0
answers
27
views
Next.js Build failed because of webpack errors: CssSyntaxError
I've been stuck and going all over internet trying to figure something that prevents my app to be build on Vercell (well locally as well).
npm run dev - works great, no issues
stylelint and eslint ...
0
votes
0
answers
29
views
Failed to decode downloaded font react project
I'm encountering an issue where I'm getting a "Failed to decode downloaded font" error when trying to load fonts in my project. Here's how I've set it up:
I have the following @font-face ...
0
votes
0
answers
12
views
Webpack does not bundle a package imported by an imported package
I have a project that uses Webpack.
This project uses package A that exposes a single file index.js.
In that file there's an import from @mui/material/styles. @mui/material is listed as a peer ...
0
votes
1
answer
18
views
Angular 18 google-auth-library errors (Webpack)
I'm getting a series of errors when running no serve with my Angular app, which is currently the latest version after installing google-auth-library. The errors are -
BREAKING CHANGE: webpack < 5 ...