Questions tagged [webpack-dev-server]

1

votes
0

answer
726

Views

Webpack dev server proxy not working

I am trying to set webpack dev server proxy. However, I am getting following error: 500 - Error occurred while trying to proxy to: localhost:8080/abc/v1/user/search/?id=123122 Here is my webpack devserver config: proxy:  { '^/abc/v1/**':  'https://my-services.net/', changeOrigin: true, secure: fal...
Vishal Gulati
1

votes
1

answer
464

Views

Webpack proxy, how to redirect when url end with specific path?

I'd like that when i try to access this URL : http://localhost:8080/123456/activites-digitales Proxy redirect request to this address : http://localhost:8082/activites-digitales I have an api on port 8082 which return JSON. With my current config file it work for : http://localhost:8080/activites-d...
Nolyurn
1

votes
0

answer
195

Views

How can I get arbitrary command line arguments past yarn and webpack-dev-server?

I'm building an Electron-based command line tool. Users will invoke it from the command line, and then it'll open a normal Electron window (which is why I'm bothering with Electron & webpack, instead of using something simpler like nexe), influenced by what they entered via CLI. I'm using webpack-de...
Tom
1

votes
0

answer
221

Views

Cannot statically analyse 'require(…, …)' while bundling coffeescript and backbone application using Webpack

I am trying to migrate from grunt to webpack in a backbone/coffeescript project. While bundling, I'm getting error Cannot statically analyse 'require(…, …)' for require statement in which dependencies are known at run time. To handle above, I'm using webpack ContextReplacementPlugin. Below is c...
pooja singh
1

votes
1

answer
188

Views

BrowseRouter MIME type error

I have react application with react-router, how you can see in the title, I use BrowserRouter, and have the following error (image): Refused to apply style from 'http://localhost:8000/public/login/main.bfa4608...css' because its MIME type {'text/html'} is not a supported stylesheet, and strict MIME...
R3tter
1

votes
0

answer
345

Views

Multiple Entry Point on Webpack by express js

I want to use multiple entry point of webpack using express js instances in react boilerplate for two different application with sharable codebase I have two html and two js files vendor.html for vendor.js and settings.html for settings.js. One Server.js with two instances of express `Server.js co...
Rohit Dubey
1

votes
0

answer
499

Views

React Webpack is not working in IE11 in production

My application is not rendering in IE11 in production(Works in chrome) . I am using the react webpack and Getting the error like this in chrome console because of webpack in production . Suggest me to debug this bug SCRIPT1002: Syntax error vendor.js (1,268483) Version 'webpack': '^2.2.1', 'webp...
Naveen Kumar
1

votes
0

answer
63

Views

How to let webpack dev server check whether the client is desktop or mobile and respond different htmls?

I'm writing a React app and it needs to adapt the desktop end and the mobile end. There're so many components in my app that I have to build a new page to send it to mobile devices. That is, the desktop and mobile browsers get different index htmls when the user visit the same index url, eg localhos...
enzeberg
1

votes
2

answer
33

Views

Can you set an alias in webpack which will replace all matching occurrences in all files and not just requires?

I'm trying to configure my react app for easy branding and styling, there are some hardcoded branding strings which I don't want to use store for, and I don't want to have to pass properties through all components for branding. But I'd like to be able to change some of the strings globally at a whi...
nikolaj frey
1

votes
1

answer
1.6k

Views

webpack-dev-server builds and rebuilds very slow

My webpack-dev-server gets work very slow. I have the following webpack.config.js file: 'use strict'; var path = require('path'); var webpack = require('webpack'); var glob = require('glob'); module.exports = { entry: { wit: [babel-polyfill', './index.js', './src/shared/styles.less'] }, output:...
Roman
1

votes
0

answer
416

Views

Webpack 4 watch content base not working

I'm using webpack 4.7 and for some reason the page isn't refreshing when I make changes. I can see my scss/css recompile but it doesn't trigger a refresh, the same for index.html I'm using commands via the package.json: 'dev': 'webpack-dev-server --open --mode development --watch-content-base js/ind...
Michael Harper
1

votes
0

answer
383

Views

Setting a cookie with a webpack-dev-server client and hapi API

I have a ReactJS client running webpack-dev-server on localhost:3000. It connects to a Hapi API server on localhost:8080 and I'm trying to provide a basic cookie using hapi-auth-jwt2 (I've also tried hapi-auth-cookie with equal results). I can see the response header provides a valid set-cookie head...
Michael
1

votes
1

answer
279

Views

After updating webpack-dev-server and webpack some modules are requested but doesn't exist

My project uses Vue.js and Typescript. I updated webpack and webpack-dev-server and now some modules are missing when I try to run in development mode. More info: My packages versions: 'npm': '6.0.0', 'webpack': '^4.8.1', 'webpack-cli': '^2.1.3', 'webpack-dev-server': '^1.16.5' Command to run app in...
Felipe Garcia
1

votes
0

answer
53

Views

Cannot point to the right bundles because of the base

I have a mean-stack website, and in index.html I have . I am trying to follow this to integrate the ESM version of the Monaco Editor by using plain webpack. I can successfully generate all the bundle files in dist folder. Now, in app.js I add app.use(express.static(path.join(__dirname, 'dist'))) an...
SoftTimur
1

votes
0

answer
53

Views

cannot read property 'createResolver' of undefined

C:\Users\VM-OUT-Kramar-YA_ALL\OPERATION\bfs-bvfo-br-pl\node_modules\webpack-dev-server\bin\webpack-dev-server.js:373 throw e; TypeError: Cannot read property 'createResolver' of undefined at WebpackOptionsApply.process (C:\Users\VM-OUT-Kramar-YA_ALL\OPERATION\bfs-bvfo-br-pl\node_modules\webpack\l...
mariamelior
1

votes
0

answer
331

Views

Webpack-Dev-Server throws WDS disconnected

the webpack dev server logs '[WDS] Disconnected!' every time the site has loaded. This confuses me because everything seems to work. The server runs in watch mode ('--watch-poll') and changes are applied immediately. For the future I would like to know if '[WDS] Disconnected!' can cause further erro...
Pascal
1

votes
0

answer
283

Views

run webpack-dev-server with '--hot' and occured an error as “configuration.entry should be one of these:”

My basic info like this: * Operating System: macos * Node Version: 8.7.0 * NPM Version: 6.0.1 * webpack Version: 4.8.3 * webpack-dev-server Version: 3.1.4 When i add '--hot' in the package.json > script > dev like this: { 'main': 'webpack.config.js', 'dependencies': {'babel-preset-react': '^6.24.1'}...
yy xia
1

votes
1

answer
291

Views

webpack-dev-server: How to open browser with Node.js API?

This is my script: const webpackDevServer = require('webpack-dev-server'); const webpack = require('webpack'); const config = require('./config'); const options = { contentBase: './dist', hot: true, hotOnly: true, open: true, host: 'localhost' }; webpackDevServer.addDevServerEntrypoints(config, opti...
李鸿章
1

votes
0

answer
229

Views

Webpack 4 Dev Server config with back end using virtual host

I'm working on a project split into 2 parts (on the same machine) : a front end using Webpack 4, a back end coded with PHP. I'm running Webpack Dev Server with the following config : ... devServer: { contentBase: '../backend/public', compress: true, proxy: { '/backend': { target: 'http://localhost:3...
Alexis Romot
1

votes
1

answer
78

Views

ngModel controller, $$updateEventHandler is undefined

i'm currently porting the development environment from gulp to webpack with out angularjs and react hybrid app. the application is huge. 10mb of files at the moment. but i am currently encountering some issues. this line: this.$$updateEventHandler = this.$$updateEventHandler.bind(this); which is ins...
1

votes
1

answer
178

Views

webpack-dev-server fails to run with error of validateSchema

this is a react hello-world proj , on local machine win7, use npm download packages, when run ' webpack-dev-server --open ' it has an error like these: F:\now\react\setup\node_modules\webpack-cli\bin\convert-argv.js:7 const validateSchema = process.webpackModule.validateSchema; TypeError: Cannot...
frontGirl
1

votes
1

answer
186

Views

I'm not able to use webpack-dev-server Unexpected token export at new Script (vm.js:74:7)

I get the following error when I run 'npm run start' or run 'node_modules/.bin/webpack-dev-server' from the command line: SyntaxError: Unexpected token export at new Script (vm.js:74:7) at createScript (vm.js:246:10) at Object.runInThisContext (vm.js:298:10) at Module._compile (internal/modules/cjs/...
user3196640
1

votes
0

answer
111

Views

Serving two entrypoints with webpack-server and Webpack4

We have two entrypoint (index and auth), that we want to be served using separate routes in development. We want the following routing when we run webpack-serve for development. / is routed to the index entry point. /auth is routed to the auth entry point. Our webpack.common.js looks like the follo...
TheJediCowboy
1

votes
0

answer
225

Views

How to configurate webpack-dev-server in laravel application?

There is a remote server on which the Laravel application is located, I downloaded the project to the local machine and synchronized it with SFTP. The first question is, where is it necessary to run the Dev assembly of Webpack (On a local machine or on a remote server) and how generally is it correc...
Alex Prom
1

votes
1

answer
1.2k

Views

webpack dev server not building and reloading index.html

I am using webpack v4 right now trying to add webpack-dev-server to my project. The Issue I am facing here is when i run the webpack-dev-server command my it opens a local server in my default browser but not serving the compiled assets and also is not watching the files for the changes. I haven't i...
Chandra Shekhar
1

votes
0

answer
89

Views

.Net Core MVC + ReactJS, Webpack issue in Safari browser

I am stuck with this weird problem. My application is working fine in Chrome, Firefox, Edge, IE11. But have some issue in Safari, I cannot even see the exact error in console. the message in console is generic asking me not to uglify/minify the scripts to see exact error. Error: *message: 'Minified...
sorabzone
1

votes
1

answer
59

Views

React route working properly when used with <Link> but not working when redirected from webpack.config.js

In my react project I am using client side routing using React Router DOM v4. Video link to my problem statement: https://drive.google.com/file/d/1nHY-dKxZvDylF5GQUTK02I8Mam1d5eru/view?usp=sharing I have created the route like this Here is my AppRouter.js file import React from 'react'; import {Br...
Vishal Shetty
1

votes
1

answer
437

Views

How can I develop locally using a domain name instead of 'localhost:3000' in the url with create-react-app?

I have been developing a small app with create-react-app and a few other libraries i added. Given the planned architecture and some tests i'd like to run with react-router, i would like to be able to run my app locally using a domain mame in the url, so that instead of localhost:3000/ it would be...
xunux
1

votes
2

answer
1.1k

Views

Webpack-Dev-Server keeps looking for src folder

I have a simple html page with one script added and trying to use webpack dev server to load the page, but it keeps returning this error to me ERROR in multi (webpack)-dev-server/client?http://localhost:3000 ./src Module not found: Error: Can't resolve './src' in 'C:\Users\etc\Desktop\etc' and this...
Siraj Kakeh
1

votes
0

answer
99

Views

How to limit number of bundles generated in webpack 4 for entry?

Can someone please explain how to configure splitChunks plugin in webpack 4, so it generates only one bundle for app (index) and one bundle (or multiple) for node modules. Currently I have the following config - entry: { app: ['./path-to-file.js'] }, output: { path: path.resolve(__dirname, 'dist'),...
user4447655
1

votes
1

answer
586

Views

HMR with webpack-dev-server doesn't reload (webpack 4)

I'm developing my new JS starter for static sites and I want to have a create-react-app-like architecture. All my webpack configuration is based on the create-react-app webpack config but using Webpack 4. When I'm launching the start.js script, a new WebpackDevServer using node API is created with...
Bastien Robert
1

votes
1

answer
260

Views

How to create production build in react application with Webpack 1.x

I'm unable to create the production build for my react application. Actually, when I run npm run build command, It's getting the dist folder and successfully built. But, getting the Red Icon in browser when I run this build version. There is no error indicating for problem. I think I'm missing some...
Chirag
1

votes
0

answer
62

Views

webpack : live reload force chrome reload even on breakpoints

My environement is Ionic, but the scope of this question relates more about webpack and the live reload functionality. When using ionic serve the livereload works as expected, my application refreshes in the browser everytime a source file changes. Something that makes me waste time though, is every...
Vincent
1

votes
2

answer
289

Views

Proxy external request

I'm trying to setup angular to proxy an external API request, not a request that hitting the same base url as where angular is running/hosted. So angular is running on http://localhost:4200/ and I want the proxy to catch requests made to http://foo.bar.baz:8080/api The below config doens't work, and...
Snæbjørn
1

votes
0

answer
257

Views

Error with webpack4 dev server proxy on a server-side rendering react hot loading app

It's been a while I'm trying to make my SSR React app work with hot reloading, but nothing works... When I set up my app as above, my first reload page displays properly, but as soon as I change something, HMR triggers, reloads the page and I end up having an error page: Error occured while trying...
pybuche
1

votes
0

answer
39

Views

Less object is empty in react, webpack

In my React project I want to use less css modules. My webpack config for css is: { test: /\.(?:le|c)ss$/, use: [ require.resolve('style-loader'), { loader: require.resolve('css-loader'), options: { importLoaders: 1, }, }, { loader: require.resolve('postcss-loader'), options: { // Necessary for exte...
gaijebou
1

votes
2

answer
455

Views

Webpack ERROR Module not found

I'm getting an error about the React module. At first, I thought it is because of how I import the Editor and Preview components to App component which is import Editor from 'Editor'; import Preview from 'Preview';. I thought I should use relative path but it didn't work. Then I also tried to add .j...
isemaj
1

votes
0

answer
116

Views

Webpack 4 dev-server proxy does not recognize the wildcard

My webpack.config.js file contains the following code inside the module.exports devServer: { host: 'localhost', proxy: { '**': { 'target': 'http://localhost:8888' } }, contentBase: path.join(__dirname, './templates'), watchContentBase: true } It works fine whenever I change a file inside /templates,...
user1449456
1

votes
0

answer
68

Views

PathLocationStrategy and webpack-dev historyApiFallback rewrites

I have something working but I have no idea why, and I would like to know why ! My app is in Angular 5 with webpack-dev-server 2.9.5. I was at first using HashLocationStrategy for my routing, but when I tried to implement OpenId connect, it appeared that I had to change. OpenID needed a redirectU...
HypnoZ
1

votes
0

answer
101

Views

Webpack cannot find image when imported - module not found

I am using webpack dev server to serve up a simple Typescript app. In it, I am trying to load an image dynamically in the Typescript like so: import img from './image.png'; const myImg = new Image(); myImg.addEventListener('load', ...); myImg.src = img; The HTML, TS, and image files are all sitting...
dawsonc623

View additional questions