publicPath is not set when not using laravel
See original GitHub issue- Laravel Mix Version: 0.11.4
- Node Version: 7.10.0
- NPM Version: 4.2.0
- OS: OSX Yosemite 10.10.1
When using laravel mix as a standalone without laravel, the publicPath variable wont be set. So when running npm run hot or npm run dev, mix will try to create the hot file in volume root /hot
. This will most likely cause a permission issue in unix based system. Sure running it with sudo will solve this, but i dont think the hot file is intended to be there right? Sorry if there’s anything that i missed.
Refer https://github.com/JeffreyWay/laravel-mix/blob/master/src/Mix.js#L80.
This issue https://github.com/JeffreyWay/laravel-mix/issues/785 most likely caused by this issue too.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10
Top Results From Across the Web
publicPath is not set when not using laravel #807 - GitHub
When using laravel mix as a standalone without laravel, the publicPath variable wont be set. So when running npm run hot or npm...
Read more >public path is not working in production but it's work in local
The simplest way to move your public folder to another one, is using the move ( mv ) command.
Read more >Where do you set the public directory in Laravel 5? - Laracasts
Rename the server. php in the your Laravel root folder to index. php and copy the . htaccess file from /public directory to...
Read more >Helpers - Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We've already laid the foundation — freeing you to create without sweating...
Read more >How to change the Laravel public folder path
These files are installed in the public folder (for example, ./public/js and ./public/css/ ). Add a line to change the default public path...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sebastiansulinski yeah I tried setting
setPublicPath
as well but that didn’t work for me. What I found did work though was keepingartisan
in the root of my project, even although it’s a non-Laravel project.I basically copied the working Laravel repo piece by piece and tried
npm run hot
each time until it broke.Not an ideal solution but it works for now.
I suggest that
public
be the default path for the package.My project is Laravel, but I am using Docker and multi-stage builds to deploy and test. At the time to
mix.version()
I would get an error and took me a while to realize what was going on.I fixed it by just
COPY artisan /app
, but could’ve avoided if there was a default path. It is a pretty common default path as well.