Home > Software design >  GET http://localhost:8080/main.js net::ERR_CONNECTION_REFUSED on deploying on Netlify console error
GET http://localhost:8080/main.js net::ERR_CONNECTION_REFUSED on deploying on Netlify console error

Time:01-21

enter image description here

The static website got published but was blank. Throwing the following error:

CodePudding user response:

The webpack.config.js file has a publicpath object which specifies the base path of all your assets. It is set by default as

output: {
    publicPath: "http://localhost:8080/main.js" ,
  },

Make it as

output: {
publicPath: 'auto',

},

CodePudding user response:

in webpack config:

output: {
    filename: "bundle.js",
    // whatever path folder
    path: path.join(__dirname, "dist"),
    publicPath: "/",
  },

In netlify, you have publish directory property. Since I output to "dist"

enter image description here

  •  Tags:  
  • Related