Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Error: Parsing file: 'import' and 'export' may only appear at the top level #151

Open
hirasso opened this issue Nov 21, 2016 · 4 comments
Open

Comments

@hirasso
Copy link

hirasso commented Nov 21, 2016

Hi there! I am just trying to get going with vueify. While re-producing your example given in the readme, I get this error:

Error: Parsing file: 'import' and 'export' may only appear at the top level

This is my app.vue file:

<style>
  .red {
    color: #f00;
  }
</style>

<template>
  <h1 class="red">{{msg}}</h1>
</template>

<script>

export default {
  data () {
    return {
      msg: 'Hello world!'
    }
  }
}

</script>

Any hint on what I am doing wrong?

@anass2010
Copy link

anass2010 commented Nov 30, 2016

make " module.exports = { " instead of " export default { "

thomas07vt added a commit to thomas07vt/vueify that referenced this issue Feb 17, 2017
@maxvint
Copy link

maxvint commented Jun 14, 2017

I've fixed by add { "presets": [ "es2015" ] } in the .bebelrc file.

@dankuck
Copy link

dankuck commented Oct 27, 2017

I was having this problem when I was using buble-loader. Attempted to use yuwenhui's solution on buble-loader instead, but it didn't work.

Using babel-loader with es2015 worked.

@samlandfried
Copy link

And for idiots like me, make sure you don't have any unclosed brackets 😅

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants