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?
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.
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.
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.
I suppose you use webpack for build server app If it true then you need add this property in webpack config
target: 'node',
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With