-
Notifications
You must be signed in to change notification settings - Fork 152
ParseError: 'import' and 'export' may only appear at the top level #228
Comments
Also ran into the same issue :( |
I realized that this issue is related to Babelify. tl; dr: To make all things work again, you need to go back to Babel 6 / Babelify 8.0 for now. This must have something to do with Babel 7. I used "devDependencies": {
"babelify": "^9.0.0", // currently babelify@next; 8.x uses Babel 6
"@babel/core": "^7.0.0-beta.47",
"@babel/preset-env": "^7.0.0-beta.47",
/* remove babel-core and babel-preset-env to avoid conflicts */
} And replace <script>
+ import OtherModule from './OtherModule.vue';
export default { And create <template>
<h1>Useless module</h1>
</template>
<script>
export default {
data () {
return {};
}
};
</script> Finally,
I am new to Babel 7, being really confused to realize the archived repo |
I was able to solve this error by adding the vueify and babelify transforms to my package.json But now I'm getting a |
the problem is https://github.com/vuejs/vueify/blob/master/lib/compiler.js#L22 |
I just hit this snag as well in setting up a fresh Vue project with all the latest packages. Is there an ETA for when |
I also ran into the error today, so I fixed (hacked?) vueify to work with Babel 7. |
I think guys the best option is to move to rollup or webpack |
@inhortte that you didn't push
Thanks, but with npm install it won't catch your changes? – i hard-copied the code. |
I get this error when generating the files:
ParseError: 'import' and 'export' may only appear at the top level
This points at the line in the .vue file where the <script> declares
export default {
I'm running the latest Node and npm on a Windows 10 machine.
Any pointers as to what might be going on will be appreaciated
The text was updated successfully, but these errors were encountered: