question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

run hot the server root path isn't public ?

See original GitHub issue

npm run hot.

Request http://127.0.0.1:8080/css/app.css got 404 error.

If I mv public/css/app.css to Laravel project root path, then request http://127.0.0.1:8080/app.css is successful.

Have any params to set the root path ?

  "hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
ankurk91commented, Jul 15, 2017

Finally i was able to make this - (v1.2.0) Just add these to your webpack.mix.js

// version does not work in hmr mode
if (process.env.npm_lifecycle_event !== 'hot') {
  mix.version()
}
const path = require('path');
// fix css files 404 issue
mix.webpackConfig({
  devServer: {
    contentBase: path.resolve(__dirname, 'public'),
  }
});

Run command npm run hot, wait for build Access your virtual host as normal, for example http://laravel-app.dev Do NOT try to access http://localhost:8080 (this is where most people get confused) Any change made in ./resources/assets folder files should reflect on virtual host domain. Make sure you’re using mix() blade helper to load assets.

@JeffreyWay The docs should be updated to reflect this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid public folder of laravel and open directly the root in web ...
I just want to avoid the 'public' in www.mylaravelsite.com/public/ and make it like www.mylaravelsite.com for the root directory. Now I do not want...
Read more >
Why is the root directory on a web server put by default in "/var ...
Usage of /var/www is confusing only at first sight. According to the FHS, web server data should go to /srv . That is...
Read more >
Public Path - webpack
Public Path. The publicPath configuration option can be quite useful in a variety of scenarios. It allows you to specify the base path...
Read more >
live-server - npm
Use it for hacking your HTML/JavaScript/CSS files, but not for deploying the ... --open=PATH - launch browser to PATH instead of server root...
Read more >
PHP Include from Root - CSS-Tricks
The problem is that PHP can see a bit “deeper” into your servers file system than HTML can. For example, the public web...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found