bradcornford / Googlmapper

An easy way to integrate Google Maps with Laravel
MIT License
464 stars 142 forks source link

Error [Vue warn]: Error compiling template: #315

Closed grandgite closed 4 years ago

grandgite commented 5 years ago

Hi, I installed this package yesterday. I have a template page with map and everything is ok. What i want is where i want. But in the console i have this error

[Vue warn]: Error compiling template:

<div id="app">
                        <nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
    <a href="http://monsite.test" class="navbar-brand">Laravel 5.7 Boilerplate</a>
...
   </div><!-- container -->
        </div>

- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.

I'm on Laravel 5.7 Boilerplate. My template is :

@extends('frontend.layouts.app')

@section('content')
    <div class="row mb-4">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <i class="fas fa-home"></i> Gite du département {{ $depts->nomdept }}
                </div>
                <div class="card-body">
                    <div id="result">
                        <div style="width: 500px; height: 500px;">

                            {!! Mapper::render() !!}

                        </div>

                    </div>
                </div>
            </div><!--card-->
            <div class="card">
                <div class="card-header">
                    <i class="fas fa-home"></i> Gite du département {{ $depts->nomdept }}
                </div>
                <div class="card-body">
                    <div id="result">

                        @include('frontend.includes.resultcategoriecentre')

                    </div>
                </div>
            </div><!--card-->
        </div><!--col-->
        <div class="col-md-4">

            <div class="card">
                <div class="card-header">
                    <i class="fas fa-home"></i>filtrage
                </div>
                <div class="card-body">

                    @include('frontend.includes.filter')

                </div>
            </div><!--card-->

        </div>
    </div><!--row-->

@endsection

Do you have an idea of why this error come here ?

grandgite commented 5 years ago

I found a solution. Problem is because javascript arrive in @section in template. So i add a @push('after-scripts') in map.blade and javascript.blade for send javascript after my @section('content') But if there is MAJ file will be remplaced...

bradcornford commented 5 years ago

Hi,

Glad you found a solution. Any chance you can create a PR for this?