Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to mount component: template or render function not defined. #24

Closed
gassio opened this issue Sep 29, 2017 · 12 comments
Closed

Failed to mount component: template or render function not defined. #24

gassio opened this issue Sep 29, 2017 · 12 comments
Labels

Comments

@gassio
Copy link

gassio commented Sep 29, 2017

I am getting an error when using the component.

Failed to mount component: template or render function not defined.

@ismet
Copy link

ismet commented Oct 4, 2017

I'm getting exactly the same error..

@FranckFreiburger
Copy link
Owner

please give more details about your configuration. vue version, webpack version, ... even code sample

@ismet
Copy link

ismet commented Oct 5, 2017

I am using the same code in your documentation : Example - complete.

The package versions are as following;

+-- axios@0.16.2
+-- babel-core@6.26.0
+-- babel-loader@7.1.2
+-- babel-preset-env@1.6.0
+-- buefy@0.5.3
+-- cross-env@5.0.5
+-- crypto-js@3.1.9-1
+-- css-loader@0.28.7
+-- file-loader@1.1.5
+-- lodash@4.17.4
+-- moment@2.18.1
+-- style-loader@0.19.0
+-- v-money@0.8.0
+-- vue@2.4.4
+-- vue-js-cookie@2.1.0
+-- vue-loader@13.0.5
+-- vue-pdf@1.2.4
+-- vue-router@2.7.0
+-- vue-template-compiler@2.4.4
+-- webpack@3.6.0
+-- webpack-dev-server@2.9.1

@accardo
Copy link

accardo commented Oct 9, 2017

I'm getting exactly the same error..

1 similar comment
@blitheinsz
Copy link

I'm getting exactly the same error..

@beerett
Copy link

beerett commented Oct 18, 2017

Getting the same error, the PDF does load albeit stretched and not scaled properly. Also I'm using the quasar framework.

<template>
<div> 
     <div v-if="recipe" class="content" :key="recipe.id">      
       <pdf :src=recipe.pdf style="width:75%"></pdf>
      </div> 
</div>
</template>
..
import pdf from 'vue-pdf'

@beerett
Copy link

beerett commented Oct 18, 2017

After countless google searching I wound up editing pdf.vue --
It looks related to the way modules are loaded -- I'm fairly new to Vue and ES in general...
I added .default to line 157 and the error is gone, looks like resizing/scaling works as well.
What led me to this: VueJS Changes

var resizeSensor = require('vue-resize-sensor').default;

@FranckFreiburger
Copy link
Owner

Thanks for sharing your investigations.
Note that I will use esm only in the next major version of vue-pdf.

@felisio
Copy link

felisio commented Nov 3, 2017

@FranckFreiburger , When you will generate a new version, fixing this bug? Thanks..

@FranckFreiburger
Copy link
Owner

please check v2.x

@accardo
Copy link

accardo commented Nov 7, 2017

image

@yiyulong
Copy link

yiyulong commented Jan 3, 2018

Thanks to @beerett, my problem has been solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants