nuxt-community / nuxt-property-decorator

Property decorators for Nuxt (base on vue-property-decorator)
https://github.com/kaorun343/vue-property-decorator
MIT License
400 stars 34 forks source link

SyntaxError: Unexpected token import #7

Closed yshrsmz closed 6 years ago

yshrsmz commented 6 years ago

I got following error in v1.1.3. when I use v1.0.0, it works fine. seems like there's no nuxt-property-decorator.umd.js in v1.1.3, and entry point of the library is nuxt-property-decorator.js which uses import (and I believe node.js does not support import syntax out of the box yet)

{ /Users/foo/repos/example/node_modules/nuxt-property-decorator/lib/nuxt-property-decorator.js:2
import Vue from 'vue';
^^^^^^

SyntaxError: Unexpected token import
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:624:28)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at r (/Users/yshrsmz/repos/androiddagashi/node_modules/vue-server-renderer/build.js:8330:16)
    at Object.<anonymous> (server-bundle.js:20887:18)
    at __webpack_require__ (webpack:/webpack/bootstrap 9be7dd6ad8a646157908:25:0)
    at Object.70 (pages/index.vue?c13f:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap 9be7dd6ad8a646157908:25:0)
    at Object.66 (pages/index.vue:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap 9be7dd6ad8a646157908:25:0)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7) statusCode: 500, name: 'SyntaxError' }
meenie commented 6 years ago

Getting the same.

DavidBernal commented 6 years ago

Fixed in 1.1.4. Touch me if the error persist.

meenie commented 6 years ago

Hi @DavidBernal, it's still broken but with a different error. The file you are pointing to in the main property of the package.json is not present when downloading your library from NPM.

image