Inline usage of vue-loader doesn't work.
See original GitHub issueVersion
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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@yyx990803 , that defeats the purpose of the ability to chain loaders, as some loaders are specifically designed to do this…
just make it happen here.