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.

Inline usage of vue-loader doesn't work.

See original GitHub issue

Version

15.2.4

Reproduction link

https://github.com/dietergeerts/fabricator-builder/tree/fabricator-builder-next

Steps to reproduce

Use the vue-loader inline, in a series of loaders, and see the error popping up. I’m working on creating something that uses this. I’ll see to create an example on github to check it out, so you’ll can investigate it.

REMARK: The link is to the source code, still have to create the sample reproduction.

What is expected?

That it also works inline, when converting the remaining request in the pitch of the previous loader.

What is actually happening?

I get the following error:

 ERROR in ./src/design-tokens/colors.docs.vue?vue&type=template&id=226cc790 (D:/Projects/fabricator-builder/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./src/design-
tokens/colors.docs.vue?vue&type=template&id=226cc790)
    Module Error (from D:/Projects/fabricator-builder/node_modules/vue-loader/lib/loaders/templateLoader.js):
    (Emitted value instead of an instance of Error)
      Error compiling template:
      <template>
        <h1>LALAL{{ test }}LALALALALALALALALALALALALALALALALA</h1>
      </template>
      <script>
      export default {
        data() {
          return {
            test: 'TESTJEEEEEEEEEEEE',
          };
        },
      };
      </script>

      - Cannot use <template> as component root element because it may contain multiple nodes.
      - 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.

     @ ./src/design-tokens/colors.docs.vue?vue&type=template&id=226cc790 1:0-170 1:0-170
     @ D:/Projects/fabricator-builder/node_modules/vue-loader/lib!./src/design-tokens/colors.docs.vue
     @ D:/Projects/fabricator-builder/loaders/html-inject-vue-loader.js!D:/Projects/fabricator-builder/node_modules/vue-loader/lib!./src/design-tokens/colors.docs.vue


I am creating the next version of Fabricator Builder, where the idea is that it’s fully based on a webpack config. For dynamic pieces, I wanted to let the users use Vue, so I’m trying to get it to work, like by just putting @[require](link.to.docs.vue) in the markdown file. When I’m finished with my workaround, I’ll create a sample with the reproduction.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dietergeertscommented, Aug 1, 2018

@yyx990803 , that defeats the purpose of the ability to chain loaders, as some loaders are specifically designed to do this…

0reactions
kindycommented, Aug 16, 2018

just make it happen here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VueLoaderPlugin doies not return HTML used as inline loader ...
But the vue loader was invoked explicitly, so should be returning HTML from my Vue template. This is using webpack@^5.8.0, html-webpack-plugin@^ ...
Read more >
Migrating from v14 - Vue Loader
We are in the process of upgrading Vue CLI 3 beta to use webpack 4 + Vue Loader v15, so you might want...
Read more >
Features | Vite
However, some libraries (e.g. vue ) don't work well with "isolatedModules": true . You can use "skipLibCheck": true to temporarily suppress the errors...
Read more >
style-loader - webpack
⚠️ Behavior is undefined when unuse is called more often than use . Don't do that. component.js import styles from "./styles.lazy.css" ...
Read more >
Using inline SVGs in Vue components - Caleb Porzio
Back to work. By now, I'm excited and ready to use my handy new html-loader to pull SVGs into my Vue component. I...
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