Heroku Server does not recognize my CSS and Javascript files

Asked

Viewed 579 times

0

I recently created a project Laravel that is using Vuejs and Axios, and then sent to the Heroku server, but something strange happened, the page is with very strange visualization and I realized that the public folder was not being viewed, but this was not to happen because I had configured the Procfile file.

This is the page

http://laraval-vue-crud-wb.herokuapp.com/

This is my main page.

<!doctype html>
<html lang="{{ app()->getLocale() }}">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

                <link href="{{ asset('lib/bootstrap/dist/css/bootstrap.css') }}" rel="stylesheet">
                <link href="{{asset('lib/toast/toastr.css')}}" rel="stylesheet">
                <link href="{{asset('css/layout.css')}}" rel="stylesheet">

        <title>Cadastro de Imoveis</title>

    </head>
    <body>

    @yield('content')

<script src="{{asset('lib/jquery/dist/jquery.js')}}"></script>
<script src="{{asset('lib/bootstrap/dist/js/bootstrap.js')}}"></script>
<script src="{{asset('lib/vue/dist/vue.js')}}"></script>
<script src="{{asset('lib/axios/dist/axios.js')}}"></script>
<script src="{{asset('lib/toast/toastr.js')}}"></script>
<script src="{{asset('lib/app.js')}}"></script>
    </body>
</html>

And this comes when I go to inspect my page;

inserir a descrição da imagem aqui

How do I fix it?

Someone’s been through this before?

I’ve already tried to do it and unsuccessfully:

<script src="{{  URL::asset('lib/jquery/dist/jquery.js') }}"></script>
<script src="{{ URL::asset('lib/bootstrap/dist/js/bootstrap.js')}}"></script>
<script src="{{ URL::asset('lib/vue/dist/vue.js')}}"></script>
<script src="{{ URL::asset('lib/axios/dist/axios.js')}}"></script>
<script src="{{ URL::asset('lib/toast/toastr.js')}}"></script>
<script src="{{ URL::asset('lib/app.js')}}"></script>

And even did not cause error when sending to Heroku:

C:\Users\Wladimir\Documents\laravel-vue-crud>git push heroku master
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 587 bytes | 587.00 KiB/s, done.
Total 7 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (7.1.11)
remote:        - ext-mbstring (bundled with php)
remote:        - nginx (1.8.1)
remote:        - apache (2.4.29)
remote: -----> Installing dependencies...
remote:        Composer version 1.5.2 2017-09-11 16:59:25
remote:        Loading composer repositories with package information
remote:        Installing dependencies from lock file
remote:        Package operations: 38 installs, 0 updates, 0 removals
remote:          - Installing algolia/algoliasearch-client-php (1.23.0): Loading from cache
remote:          - Installing doctrine/inflector (v1.2.0): Loading from cache
remote:          - Installing doctrine/lexer (v1.0.1): Loading from cache
remote:          - Installing erusev/parsedown (1.6.3): Loading from cache
remote:          - Installing vlucas/phpdotenv (v2.4.0): Loading from cache
remote:          - Installing symfony/css-selector (v3.3.10): Loading from cache
remote:          - Installing tijsverkoyen/css-to-inline-styles (2.2.0): Loading from cache
remote:          - Installing symfony/polyfill-mbstring (v1.6.0): Loading from cache
remote:          - Installing symfony/var-dumper (v3.3.10): Loading from cache
remote:          - Installing symfony/routing (v3.3.10): Loading from cache
remote:          - Installing symfony/process (v3.3.10): Loading from cache
remote:          - Installing symfony/http-foundation (v3.3.10): Loading from cache
remote:          - Installing symfony/event-dispatcher (v3.3.10): Loading from cache
remote:          - Installing psr/log (1.0.2): Loading from cache
remote:          - Installing symfony/debug (v3.3.10): Loading from cache
remote:          - Installing symfony/http-kernel (v3.3.10): Loading from cache
remote:          - Installing symfony/finder (v3.3.10): Loading from cache
remote:          - Installing symfony/console (v3.3.10): Loading from cache
remote:          - Installing egulias/email-validator (2.1.2): Loading from cache
remote:          - Installing swiftmailer/swiftmailer (v6.0.2): Loading from cache
remote:          - Installing paragonie/random_compat (v2.0.11): Loading from cache
remote:          - Installing ramsey/uuid (3.7.1): Loading from cache
remote:          - Installing psr/simple-cache (1.0.0): Loading from cache
remote:          - Installing psr/container (1.0.0): Loading from cache
remote:          - Installing symfony/translation (v3.3.10): Loading from cache
remote:          - Installing nesbot/carbon (1.22.1): Loading from cache
remote:          - Installing mtdowling/cron-expression (v1.2.0): Loading from cache
remote:          - Installing monolog/monolog (1.23.0): Loading from cache
remote:          - Installing league/flysystem (1.0.41): Loading from cache
remote:          - Installing laravel/framework (v5.5.19): Loading from cache
remote:          - Installing fideloper/proxy (3.3.4): Loading from cache
remote:          - Installing jakub-onderka/php-console-color (0.1): Loading from cache
remote:          - Installing laravel/scout (v3.0.10): Loading from cache
remote:          - Installing nikic/php-parser (v3.1.1): Loading from cache
remote:          - Installing jakub-onderka/php-console-highlighter (v0.3.2): Loading from cache
remote:          - Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache
remote:          - Installing psy/psysh (v0.8.13): Loading from cache
remote:          - Installing laravel/tinker (v1.0.2): Loading from cache
remote:        Generating optimized autoload files
remote:        > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover
remote:        Discovered Package: fideloper/proxy
remote:        Discovered Package: laravel/scout
remote:        Discovered Package: laravel/tinker
remote:        Package manifest generated successfully.
remote: -----> Preparing runtime environment...
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 18.3M
remote: -----> Launching...
remote:        Released v18
remote:        https://laraval-vue-crud-wb.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/laraval-vue-crud-wb.git
   fd31a3c..d6c6b64  master -> master
  • in fact the error is because of the path that meets the file javascript app.js , I put it inside a folder called app and changed and updated the path on the main page, but it was the same thing, If you want to try you can download my application creates an account for you in Heroku and you even test. is done I said, I have no experience in putting projects in Heroku, so I don’t even know where to start to investigate what would be the problem, you have already put project in Heroku in which the project use?

  • please @Darlei Fernando you know a better way to configure the Laravel project for him to see the Vue project in Heroku?

  • 1

    @Darleifernandozillmer is important to analyze that this github project is from an old version of Laravel and the mute documentation.

  • thanks, thank you very much.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.