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.

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:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
1stevengrantcommented, May 23, 2017

@sebastiansulinski yeah I tried setting setPublicPath as well but that didn’t work for me. What I found did work though was keeping artisan 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.

0reactions
jsgvcommented, Aug 15, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

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