Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
Webpack doesn't load HTML

I get 404 not found error when loading the HTML page with webpack. These are my configurations.

Webpack.config.js:

const path = require('path');

module.exports= {
    devServer: {
        // contentBase
        static : {
          directory : path.join(__dirname, 'public/')
        },
        port: 3000,
        // publicPath
        devMiddleware:{
           publicPath: 'https://localhost:3000/dist/',
        },
        // hotOnly
        hot: 'only',
      },
};

The other file configurations are on the screenshot. The webpack server runs correctly, but when I try to load the page I get this error. Please tell me where I am wrong.

Screenshot of the other files. webpackProblem

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Do you have your index.html in the right place in your /public folder?

From the webpack docs:

To load your bundled files, you will need to create an index.html file in the build folder from which static files are served (--content-base option).

Or try put this in webpack.config.js:

 devServer: {
  historyApiFallback: true,
}

Or sometimes you could need to point out your historyApiFallback index.html file like this:

 devServer: {
        historyApiFallback:{
            index:'build/index.html'
        },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!