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

Vue loader bug with class field #1740

Closed
snigle opened this issue Oct 13, 2020 · 2 comments
Closed

Vue loader bug with class field #1740

snigle opened this issue Oct 13, 2020 · 2 comments
Labels

Comments

@snigle
Copy link

snigle commented Oct 13, 2020

Version

16.0.0-beta.8

Reproduction link

https://github.com/snigle/vue3Webpack

Steps to reproduce

Create webpack project from scratch with vue@next and vue-loader@next.
Make project working with simple vue component single file.
Declare a typescript class in the <script lang="ts">
Compilation will fail

What is expected?

compilation OK

What is actually happening?

ERROR in ./src/App.vue?vue&type=template&id=7ba5bd90&bindings=undefined (./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[3].use[0]!./src/App.vue?vue&type=template&id=7ba5bd90&bindings=undefined)
Module build failed (from ./node_modules/vue-loader/dist/templateLoader.js):
SyntaxError: Unexpected token u in JSON at position 0


I put a simple application in my repo to reproduce

@snigle
Copy link
Author

snigle commented Oct 13, 2020

the code which break is here :
https://github.com/snigle/vue3Webpack/blob/main/src/App.vue

<script lang="ts">
import {defineComponent, ref} from "vue";
// This class break the webpack vue-loader
class Test {
    myTest = "ok"
}
export default defineComponent({
// ...
});
</script>

@haoqunjiang
Copy link
Member

Fixed in beta.9

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

2 participants