Closed dbelyaeff closed 4 years ago
Find issue reason.
Parcel doesn't automatically catch file by it's extension:
import App from './App'
File extension should be implicit.
import App from './App.vue'
At the same time I've get next error:
π¨ /Users/dima/Sites/parcel/App.vue:3:0: 'import' and 'export' may only appear at the top level (3:0)
1 | <template lang="pug">
2 | div
> 3 | h1 {{text}}
| ^
4 | </template>
5 | <script lang="coffee">
6 | export default
The error is about PUG template in Vue SFC App.vue
. It's not a script section.
Looks like it's an error of embed linter.
mark
I've found out that it's coffeescript compiler problem.
<template lang="pug">
div
h1 {{text}}
ui-alert() Fix this
</template>
<script lang="coffee">
export default
name: 'app'
data: ->
text: 'Test6'
</script>
<style lang="stylus">
body
background rgba(0,0,0,0.1)
h1
font-size 2em
</style>
When I rewrote coffee to standard JS, everything become works.
Please fix coffee compiler for Vue Single File Components.
Sounds like you should report to parcel-plugin-vue.
mark
cc @shawwn
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
Hi there!
π bug report
Vue SFC doesn't loads properly.
π Configuration (.babelrc, package.json, cli command)
.babelrc
package.json
index.pug
app.coffee
App.vue
π€ Expected Behavior
Don't pay attention to pug and coffee. I've tried before using clean HTML and JS. The results were the same.
Every time I've got following error:
π Your Environment