42,763
questions
0
votes
0
answers
7
views
Electron: Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'dist/main/menu'
I get the following error when I run npm start
The file does exist in the path. But I still get the error.
App threw an error during load
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/dist/main/...
1
vote
1
answer
31
views
HtmlBundlerPlugin error, import at-rules in CSS is not bug?
src/index.html
src/layout/header.html
src/css/common/iconfont.css
head.html:
<link rel="stylesheet" href="@styles/common/iconfont.css">
index.html:
<%~ include('layout/...
0
votes
0
answers
11
views
Next.js Parallel Routes with WebPack
I am using parallel routes in my Next.js application. I have a dashboard, which consists of header and content, thus the directory structure:
Dashboard
@header
loading.tsx
page.tsx
@content
...
1
vote
0
answers
16
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: ...
1
vote
0
answers
27
views
empty object returned with a bundled js library with webpack
Attempting to use graphology-layout-forceatlas2 on web.
Couldn't find a working build online.
Used webpack to create a bundle, however when included it returned an empty object even though there was ...
0
votes
2
answers
24
views
Why am I receiving undefined in the renderer process even though the main process logs a valid payload?
I am working on an Electron.js application and trying to pass a token from the main process to the renderer process using ipcMain and ipcRenderer. However, when I attempt to log the received data in ...
0
votes
0
answers
19
views
__dirname give the wrong path
Trying to use __dirname in webpack, the project path is like /home/myname/workplace/projectname
but
console.log(`__dirname: ${__dirname}`);
returned:
__dirname: /local/home/myname/workplace/...
0
votes
0
answers
16
views
Using webpack + firebase, fs.js is creating paths to a directory rather than a file
I am trying to get a very basic project running using both webpack and firebase. However, I am running into issues when using firebase serve to locally host my site. The site should simply load ...
1
vote
1
answer
14
views
packaging block.json renderTemplate in basic webpack setup using @wordpress scripts
On a Wordpress install, I am using ACF Blocks with “block.json”, where my blocks are compiled from a /source directory to a /build directory, where they are registered via register_block_type. I’m ...
0
votes
1
answer
44
views
Can't access lexical declaration 'rm' before initialization
im working on a Angular 13 project using webpack and recently I started getting this error after making base classes and adding more inheritance:
Can't access lexical declaration 'rm' before ...
1
vote
1
answer
33
views
Error in the schema entry point webpack 5 multiple entry point
I was setting up a React project for a Chrome extension in which I needed more than one entry point and output in webpack, but I got an error when trying to configure more than one entry point in the ...
-2
votes
0
answers
34
views
Run javascript function using symfony form and twig [duplicate]
I'm trying to execute a function when the user press a key on a form input. To do so, I'm using Symfony with Twig and webpack. Now, when I pass the attribute onkeydown to call the function test(), in ...
0
votes
0
answers
24
views
Bundling, minifying and transposing Javascript to ES5 [closed]
I created a javascript library that follows jQuery syntax but relies entirely on more modern processes like querySelectAll. Whilst everything it uses is supported by ES5, I wrote it using ES6 classes ...
1
vote
0
answers
10
views
Webpack error: TypeError: BundleDeclarationsWebpackPlugin is not a constructor
I am getting this error when merging typescript files using the Webpack BundleDeclarationsWebpackPlugin.
TypeError: BundleDeclarationsWebpackPlugin is not a constructor
What's wrong with my ...
0
votes
0
answers
23
views
Asset prefix not working - can I write a script to locate and change the bundle.js?
What's happening is when I run the build step for my next.js project the assetPrefix and the basePath are not being applied to some files. Specifically the bundled .json for each path and another ...
0
votes
0
answers
16
views
Webpack 5 splitChunks.chunks = "all" causes modules not to load
I am trying to set up webpack to build my source code into its own output bundle, and output all node_modules to their own separate vendor file(s). I am using webpack-bundle-analyzer to see what's ...
1
vote
2
answers
33
views
Add a script at the end of HTML with HtmlWebpackPlugin
I have a React application with an index.html file in the public folder:
<!DOCTYPE html>
<html lang="ru-RU">
<head>
<meta charset="utf-8" />
<...
0
votes
0
answers
33
views
After upgrading to Webpack 5, third party module CSS stop loading - ReactJS
I'm encountering an issue after upgrading from Webpack 4 to Webpack 5 where the SunEditor CSS isn't loading correctly within the component. I've tried using mini-css-extract-plugin along with various ...
0
votes
0
answers
86
views
TypeError: Cannot read properties of undefined (reading 'getStackAddendum') in React production build
I'm encountering a TypeError when building my React application for production. The error message is:
TypeError: Cannot read properties of undefined (reading 'getStackAddendum') at printWarning ...
...
1
vote
1
answer
17
views
HtmlWebpackPlugin: trying to add a script in existing index.html
In webpack.config.ts using HtmlWebpackPlugin as -
new HtmlWebpackPlugin({
template: 'IndexFile/index.html',
// inject: 'body',
templateParameters: {
...
0
votes
0
answers
24
views
Automatic publicPath is not supported in this browser error when running tests with Jest and external dependency in a React project
I'm encountering an error when running Jest tests that involve an internal package built with React and Webpack. This issue only arises in the Jest testing environment and does not occur when running ...
0
votes
0
answers
28
views
+100
Import typescript source code file (not transpiled code) in ionic app from node_modules package
I want to know if it's possible (not talking about: is it a "good practice") in an Ionic application to directly import typescript source code files from an installed module in node_modules ...
1
vote
1
answer
23
views
HTML Bundler Webpack Plugin - Keep Assets Directory Structure Problem
I am using HTML Bundler Webpack Plugin and following the documentation to keep the directory structure for assets: https://github.com/webdiscus/html-bundler-webpack-plugin?tab=readme-ov-file#how-to-...
2
votes
1
answer
48
views
Webpack sass-loader not generating correct source maps
I have a webpack config which contains sass-loader. When i remove the sass-loader i can see properly generated source maps. But when i add sass-loader back sourcemaps are broken.
entry: {
...
0
votes
0
answers
37
views
In an ASP.NET web forms project (.NET Framework) how do I simply concatenate scripts together, preferably also minify them, and do this at build time?
I have an ASP.NET Web Application and a bunch of legacy scripts that are being bundled together using the Visual Studio "Bundler & Minifier" extension. These are just creating library ...
-1
votes
1
answer
30
views
npm run production stops at 43 percent
I'm working on this codebase that's using laravel mix and laravel 10.
npm run dev, development, watch and even hot are all running fine but npm run production stops at 43%.
I've tried all the ...
0
votes
0
answers
29
views
Webpack Module Federation: How does initial consume will work inside ConsumeSharedRuntime module?
I'm working with Webpack's Module Federation and trying to understand how the initial consumption behaves within the ConsumeSharedRuntime module. Specifically, I want to know how shared dependencies ...
0
votes
3
answers
95
views
How to approach minification of HTML literals inside JS bundle [closed]
I have a small node app using webpack and babel to render the production JS -- generate an optimised and minified js bundle.
In the source JS, for clarity and easy maintenance, I have HTML literals ...
0
votes
0
answers
17
views
Add node modules to Webpack virtually
https://www.npmjs.com/package/webpack-virtual-modules
var virtualModules = new VirtualModulesPlugin({
'node_modules/module-foo.js': 'module.exports = { foo: "foo" };',
'node_modules/...
1
vote
0
answers
39
views
Module parse failed: Unexpected token (1:3)
I build a SSR project using webpack and it runs totally fine. But when I apply SCSS in my project, it give me an error:
ERROR in ./src/client/styles/Calculator.scss 1:3
Module parse failed: ...
-1
votes
0
answers
52
views
Vuejs Component extends not working in webpack production mode [duplicate]
I make a componentChild extends componentParent.
It is describe in https://vuejs.org/api/options-composition#extends
// componentParent.vue
<template>
<div>componentParent</div>
&...
3
votes
0
answers
89
views
Webpack not generating chunks for React.lazy imports with babel & react native web
I'm working on a React native web project (with custom Webpack config) and using React.lazy with dynamic imports for code splitting. However, Webpack isn't generating separate chunks for these imports ...
2
votes
0
answers
110
views
Sentry with WebPack results in no source context on Sentry
UPDATE: My sourcemap https://pastebin.com/vj3EHTMV
PS. I have just added inlineSources to true on tsconfig.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"...
0
votes
0
answers
55
views
When Register Component twice with same tage name globally, Then Component not rendered when webpack production build
I register componentA globally using Vue.component ( name is 'componentA' );
And create new componentB this way
<script>
// componentB.vue
import componentA from './componentA.vue';
export ...
0
votes
1
answer
27
views
Audio playing onload and not onclick (involves webpack)
I'm making a note sequencer web application and I am currently trying to implement the function of playing a note on pressing a button corresponding to the note. I am currently using a test sound to ...
0
votes
0
answers
11
views
bulma 1.0 gives the error `@use rules must be written before any other rules`
I just upgraded to bulma v1.0 and I'm getting this error:
ERROR in ./src/app.sass
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build ...
0
votes
1
answer
27
views
Cannot read properties of undefined (reading 'module') in Angular unit tests
This is what we have in angular.json for testing.
"test": {
"builder": "@angular-builders/custom-webpack:karma",
"options": {
&...
0
votes
0
answers
32
views
Why does webpack conditionally exclude certain modules with potential side effects from the bundle?
I have two pieces of code that look almost identical, but when I build them with webpack, I notice a key difference in the resulting bundles.
In one case, the module is included in the bundle, while ...
0
votes
1
answer
51
views
Environment variables not working with Webpack Encore in Docker container [closed]
I've got a Symfony project with Webpack Encore. MySQL, PHP, Mercure, Yarn/NodeJS, etc. are installed on my machine. Environment variables are accessible by my front-end code.
Relevant code snippets:
# ...
0
votes
0
answers
26
views
Serve App with webpack and have Cypress Tests run in a Docker Environment
My Cypress Docker Container does not reach my Frontend (React App bundled with webpack) in another Container.
Have a look at my docker compose yml and the Dockerfiles
Dockerfile Cypress Project
FROM ...
-1
votes
1
answer
44
views
What configuration should be used to obfuscate Angular 18 project with javascript-obfuscator?
What configuration should be used to obfuscate Angular 18 project with javascript-obfuscator ?
I am using package.json
{
"name": "angular.dev",
"version": "0.0.0&...
1
vote
0
answers
10
views
Error: Cannot find module 'D:\NEXTJS\sample-next-micro\node_modules\next\dist\compiled\lib\ModuleNotFoundError'
when npm run dev, i get this error
Error: Cannot find module 'D:\NEXTJS\sample-next-micro\node_modules\next\dist\compiled\lib\ModuleNotFoundError'
how to fix it?
my package.json
...
"dependencies&...
0
votes
0
answers
38
views
Nextjs 14 chunks not loading in prod build
I have a nextjs 14 application which I need to deploy to k8s. We've built a docker image from nextjs docs and deployed it to our DO cluster.
When trying to access the application, some chunks are not ...
0
votes
0
answers
30
views
Preventing Webpack Build Process from Deleting Optimized Images in Custom Gutenberg Blocks Plugin
I'm developing a custom Gutenberg blocks plugin and have integrated an image optimization process into my workflow. I'm using sharp in a custom Node.js script to generate optimized WebP versions of ...
1
vote
1
answer
109
views
CRA/webpack production error: t[s] is not a function
I'm getting this strange error in a React CRA app in production builds only:
bootstrap:19 Uncaught TypeError: t[s] is not a function
at i (bootstrap:19:22)
at Game.ts:142:3
at index.tsx:19:...
0
votes
0
answers
31
views
How can I configure the NextJS dev server?
If I'm understanding it correctly, NextJS is using the webpack dev server (unless you're opting into Turbopack) - and webpack can be configured via the webpack property of the next.config.js file (...
1
vote
1
answer
112
views
How to setup Vite in Angular after using Webpack
After updating to Angular 18 and choosing Vite as the Build tool, some packages are not resolved, i.e.:
X [ERROR] Could not resolve "@angular/common/http"
../../../../http-options.ts:1:...
0
votes
0
answers
32
views
Angular load module providers with withModuleFederationPlugin
I am using Angular 15 with MFE.
In the shell webpack.config.js I have:
const {
shareAll,
withModuleFederationPlugin,
} = require("@angular-architects/module-federation/webpack");
const ...
1
vote
0
answers
22
views
Nx serve webpack @mf-types zipped
When I'm serving my webpack application through nx the types generated are all zipped. How can I set up properly the generation of the remote types?
This are my configurations:
const { merge } = ...
0
votes
0
answers
44
views
Webpack hot-reload or react-refresh-webpack-plugin not working
Trying to migrate an old react app to React 17 & Webpack 5, the app is loading now but hot-reload or react refresh webpack plugin is not working.
As soon as there's a change, the page crash and ...