vue 2.6+ named slot and pug causes error
See original GitHub issueVersion
1.0.0-beta.29
Reproduction link
https://github.com/yoyoys/vue-slot-pug-bug-jest-reproduction
Steps to reproduce
- create project by vue-cli 3.6.3, using jest, TypeScript, TSLint, Class Component
npm i -D pug pug-plain-loader
- add a component which has named slot (SlotGuy.vue)
- run
npm run test:unit
What is expected?
test run success
What is actually happening?
I’ve got a error below:
● Test suite failed to run
SyntaxError: Unexpected character '#' (1:150)
at Parser.pp$4.raise (node_modules/vue-template-es2015-compiler/buble.js:2757:13)
at Parser.pp$8.getTokenFromCode (node_modules/vue-template-es2015-compiler/buble.js:4906:8)
at Parser.pp$8.readToken (node_modules/vue-template-es2015-compiler/buble.js:4628:15)
at Parser.readToken (node_modules/vue-template-es2015-compiler/buble.js:6029:22)
at Parser.pp$8.nextToken (node_modules/vue-template-es2015-compiler/buble.js:4619:15)
at Parser.pp$8.next (node_modules/vue-template-es2015-compiler/buble.js:4576:8)
at Parser.pp.eat (node_modules/vue-template-es2015-compiler/buble.js:577:10)
at Parser.pp.expect (node_modules/vue-template-es2015-compiler/buble.js:641:8)
at Parser.pp$1.parseFunctionParams (node_modules/vue-template-es2015-compiler/buble.js:1230:8)
at Parser.pp$1.parseFunction (node_modules/vue-template-es2015-compiler/buble.js:1218:8)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:7
Top Results From Across the Web
How to use the new v-slot directive in Vue.js - VueDose
Simplify the use of scoped slots with the new v-slot syntax introduced in Vue.js 2.6.0 beta 3.
Read more >vue Dynamic Slot Names Error Templates should only be ...
I am using Vuejs(2.6.11) Dynamic Slot Names Eerror: Templates should only be responsible for mapping the state to the UI.
Read more >'Unrecognized Slot name' error on v-slot:header declaration
For locally declared components the named slots are behaving without errors. Also, the project is using Vue 2.6.12 while WebStrorm says 2.6.0 ....
Read more >vue-server-renderer | Yarn - Package Manager
2.7.14 (2022-11-09). Bug Fixes. compiler-sfc: fix template usage check edge case for v-slot destructured default value (#12842 (5e3d4e9), closes #12841 ...
Read more >Table | Components - BootstrapVue
This may cause GUI issues such as sub components/elements that are ... When using the new Vue 2.6 v-slot syntax, note that slot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good one! Thanks @Shinigami92!
I added
to my
jest.config.js
and now it works as expected.IMO this should be the default