Automatic publicPath is not support ed in this browser

Viewed 2559

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?

2 Answers

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

 target: 'node',

I would suggest just revert back to Webpack version 4(v4) from version 5(v5) & the error will be gone. Version 5 for the time being is difficult to manage & has lot of problems with it.

Related