Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic publicPath is not support ed in this browser

Tags:

webpack

I have tried to start my webpack build and I got this error as below:

if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser").... Webpack version was v5-3-0.

I second time meet Webpack and I got confused. My previous webpack.config.js was the same, but Webpack version was v4-44-2.

What could you recommend about it?

like image 909
user14535108 Avatar asked Oct 29 '20 12:10

user14535108


People also ask

What is publicPath?

publicPath specifies the virtual directory in web server from where bundled file, app. js is going to get served up from. Keep in mind, the word server when using publicPath can be either webpack-dev-server or express server or other server that you can use with webpack.

What is webpack in react?

Like create-React-app, React Webpack is also a command-line tool used to create a bundle of assets (files and code). It doesn't run on the browser or the server. It takes all the JS files and other assets, transforming them into one large file.

What is webpack used for?

Webpack is a free and open-source module bundler for JavaScript. It is made primarily for JavaScript, but it can transform front-end assets such as HTML, CSS, and images if the corresponding loaders are included. Webpack takes modules with dependencies and generates static assets representing those modules.


1 Answers

I suppose you use webpack for build server app If it true then you need add this property in webpack config

 target: 'node',
like image 82
Serhii Popadiuk Avatar answered Oct 21 '22 13:10

Serhii Popadiuk