error: Expected "class" but found "const" in Vite2
See original GitHub issueI tried switch vite version to 1.0rc, it’s fine, but error on 2.0 And if no “@Options”, it’s fine too, but how can i include components
package.json
"dependencies": {
"vue": "3.0.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.0.4",
"@vue/compiler-sfc": "^3.0.5",
"@vuedx/typecheck": "^0.4.1",
"@vuedx/typescript-plugin-vue": "^0.4.1",
"sass": "^1.32.2",
"typescript": "^4.1.3",
"vite": "^2.0.0-beta.10",
"vue-class-component": "^8.0.0-rc.1"
}
App.vue
<script lang="ts">
// import { defineComponent } from 'vue'
import HelloWorld from './components/HelloWorld.vue';
import { Vue, Options } from 'vue-class-component';
@Options({
components: {
HelloWorld,
},
})
export default class App extends Vue {
}
</script>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
error: Expected "class" but found "const" in Vite2 - Bountysource
I tried switch vite version to 1.0rc, it's fine, but error on 2.0. And if no "@Options", it's fine too, but how can...
Read more >Error: Unexpected "<" in Vite Vue in JS files - Stack Overflow
ResourceCenterIcon.jsx export const resourceCenterIcon = <svg>...</svg>. Then import it, and use like a component:
Read more >Features | Vite
Most libraries expect "useDefineForClassFields": true , such as MobX, Vue Class Components 8.x, etc. But a few libraries haven't transitioned to this new ......
Read more >Asset Bundling (Vite) - The PHP Framework For Web Artisans
Have you started a new Laravel application using our Vite scaffolding but need ... Within a fresh installation of Laravel, you will find...
Read more >Getting Started with Vitest | Vue Mastery
Vitest uses the same configuration as Vite, and shares a common ... Vitest also allows for extra configuration which can be found in...
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
This is more like Vite transpile issue.
I found same issue in vite here: https://github.com/vitejs/vite/issues/1476