In this article, I will be showing you how to deploy a Laravel/Vue application to Heroku; a container-based cloud Platform as a Service (PaaS), whi...
For further actions, you may consider blocking this person and/or reporting abuse
I did it, and it worked. But why does my vue not work when deployed ???
has been resolved! This happened because my laravel asset file was produced as http, the solution was to change to https. This is because heroku uses https, if using http on heroku the browser will block the request😄
Hi, how were you able to change http to https and new in Heroku just help
In your blade template file where your app.js is imported, change asset() to secure_asset().
HELLO, I DONT HAVE THE asset() :3 please help me
please replyyy
do you have an app.blade.php file in resources/views? look in there for link and script tags.
okay wait a minute
i searched it, it has many asset() tho, some are css bootstrap etc
asset('js/bootstra') }}
is this one your referring to? i cant send the asset. it is hidden
yes. change them all to secure_asset( ... ).
I am glad you were able to resolve it 😄
remote: Skipping 'fsevents' build as platform linux is not supported
remote: npm ERR! Cannot read property 'length' of undefined
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.Ta3zs/_logs/2020-06-01T23_28_55_378Z-debug.log
insert code below to scripts in package.json
"scripts": {
"heroku-prebuild": "npm install -f",
"heroku-postbuild": "npm run build"
}
Still getting the error after adding the scripts. And what npm run build supposed to be doing? Laravel's package.json scripts by default only has dev, watch and prod.
I am not sure if build is an old key for prod. Please correct me if I'm wrong.
I got it working using this:
That rebuilt the assets multiple times, so I trimmed it down to just this and it seems to be all that is needed. At least, it is working for me now:
Hi, can someone help me with this? I have a similar issue like this and I have tried most of the options in the comment bellow but my page is still not loading any content.
Am I missing something or?
site bmchh-store.herokuapp.com/
Hey there, I know this post is 1 year old but however I can't seem to get Heroku to display something other than a blank page. All I get is "Uncaught SyntaxError: Unexpected token '<'" in the browser console.
I tried changing to secure_asset() & it still shows the same error in the console.
Thank you so much!
You are welcome
It works like a charm! Thanks!
You are welcome, I am glad it was helpful.
How i can fix this problem please !!
Mixed Content: The page at 'managementp.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'managementp.herokuapp.com/css/app.css'. This request has been blocked; the content must be served over HTTPS.
You'll have to edit
App\Http\Middleware\TrustProxies.php
to look like this:I did it, I launch my first Laravel/Vue app. Thank's
hey can someone help me?
remote: ! ERROR: Application not supported by this buildpack!
remote: !
remote: ! The 'heroku/php' buildpack is set on this application, but was
remote: ! unable to detect a PHP codebase.
remote: !
remote: ! A PHP app on Heroku requires a 'composer.json' at the root of
remote: ! the directory structure, or an 'index.php' for legacy behavior.
remote: !
remote: ! If you are trying to deploy a PHP application, ensure that one
remote: ! of these files is present at the top level directory.
remote: !
remote: ! If you are trying to deploy an application written in another
remote: ! language, you need to change the list of buildpacks set on your
remote: ! Heroku app using the 'heroku buildpacks' command.
remote: !
remote: ! For more information, refer to the following documentation:
remote: ! devcenter.heroku.com/articles/buil...
remote: ! devcenter.heroku.com/articles/php-...
these are the errors but I already have a composer.json on the root file but still can't push it on the heroku
So based on the documentaries that you have post, you no composer.json so how did you build the dependencies of php or laravel?
When i push to heroku this error. Please help
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git.heroku.com/herokuexample098.git'
You have to commit your changes before you push to Heroku.
I'm currently experiencing the same error, please how did you solve it
I keep getting this when i try to push
! [remote rejected]
master -> master (pre-receive hook declined)
error: failed to push some refs to 'git.heroku.com/igudyemployeemanage...'
Please, my vue is still returning localhost, after I have changed the API to live one.
The live API is working on my Postman, but not in my vue. I don't know what's wrong.
I need help pleaseeeee!!
well done
Thanks
Mad o
Thank you, Chinedu.
How do you resolve the "Access forbidden error"?
The server is not reading from the index.php file in public folder as specified in the procfile file.
Make sure that your procfile is in the root directory and ensure that there is no " around web: vendor/bin/heroku-php-apache2 public/ in your procfile.
i use laravel jetstream in my project when I upload on Cpanel it work currect but when I want to change something it's not working i think it's not compiled. can someone help me?
I have a problem when the page is reloaded
Not Found
The requested URL was not found on this server.