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.

"Failed to mount component: template or render function not defined" when running `npm run styleguide`

See original GitHub issue

I get the following errors for all my components when trying to add styleguidest to an existing repo that is imported to other projects like a library as a submodule

[Vue warn]: Failed to mount component: template or render function not defined.

found in
---> <Modal> at vue/Modal.vue
       <Anonymous>
         <Root>

The structure is

- - vue/
- - - - Modal.vue
- - - - OtherComponents.vue
- - scss/
- - - - Modal.scss
- - - - OtherComponents.scss
- - styleguide.config.js
- - webpack.config.js

The styleguide config looks like this

module.exports = {
	title: 'Style Guide',
	components: './vue/**/[A-Z]*.vue',
	defaultExample: true,
	webpackConfig: require('./webpack.config'),
	exampleMode: 'expand'
}

and the webpack config is

const path = require('path');

module.exports = {
  module: {
    rules: [
      {
        include: [
          path.resolve(__dirname, "vue")
        ],
        exclude: /node_modules/,
        loader: "vue-loader"
      },
      {
        test: /\.js?$/,
        exclude: /node_modules/,
        loader: "babel-loader"
      },
      {
        include: [
          path.resolve(__dirname, "scss")
        ],
        loader: "sass-loader"
      }
    ]
  }
};

Any thoughts why this would be happening?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
elevatebartcommented, Apr 1, 2020

feel free to re-open if needed

1reaction
elevatebartcommented, Mar 7, 2020

You rock ! and thank you \o/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue Failed to mount component: template or render function ...
The compiling goes fine but when I try to preview the page it gives me the following error: [Vue warn]: Failed to mount...
Read more >
Failed to mount component: template or render function not ...
Any thoughts? I want load a vue file into another .vue file See example: https://gi. ... Failed to mount component: template or render...
Read more >
Guide to Unit Testing Vue Components - TestDriven.io
This article serves as a guide to unit testing Vue components. We'll first look at why unit testing is important for creating maintainable ......
Read more >
Vue.js Failed to mount component: template or render function ...
... Vue.js Failed to mount component: template or render function not defined ... I'm running app at localhost:3000 with browserSync and npm run...
Read more >
Vue.js style guide - GitLab Docs
Do not use %template in HAML. Explicitly define data being passed into the Vue app. // bad return new Vue({ el: '#element', components:...
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