EvodiaAut/vue-focuspoint-component

SyntaxError: Unexpected token import

emdahlstrom opened this issue · 1 comments

Hi!
I think I have run into an incompatibility with the Nuxt framework, though I'm not sure. When I use the component on a page component in Nuxt I get the error below. Has anyone else seen this issue?

The component seems to itself be doing an import which fails with SyntaxError: Unexpected token import

{ interact/node_modules/vue-focuspoint-component/src/index.js:1
(function (exports, require, module, __filename, __dirname) { import FocusPoint from './components/FocusPoint'
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:152:10)
    at Module._compile (module.js:605:28)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at r (/home/em/Code/interact/node_modules/vue-server-renderer/build.js:8147:16)
    at Object.<anonymous> (server-bundle.js:3988:18)
    at __webpack_require__ (webpack:/webpack/bootstrap 2e1f12652a9850c8e136:25:0)
    at Object.180 (pages/implement/hero-form-connected.vue?7c3f:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap 2e1f12652a9850c8e136:25:0)
    at Object.105 (pages/implement/hero-form-connected.vue:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap 2e1f12652a9850c8e136:25:0)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) statusCode: 500, name: 'SyntaxError' }

Hi @emdahlstrom!

I think Nuxtjs doesn't support external resources without right configuration.

When you search Nuxtjs Unexpected token import i think you find good solutions or nuxt/nuxt#2392