New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: "Cannot use import statement outside a module" ( Nuxt.js ) #11
Comments
Do we have any update on this? |
I believe Nuxt SSR doesn't handle ES6 modules. I want to make this package transpile to CommonJS, but I'm currently very busy with my day job. If anyone wants to make a PR with Webpack/Babel configuration, I'll definitely look at it. |
Maybe is related to this: I don't know if with the transpile option it can work: |
I think I have a workaroud. Instead of importing the
import Vue from 'vue'
import { Stack, StackItem } from 'vue-stack-grid'
Vue.component('Stack', Stack)
Vue.component('StackItem', StackItem) And then, in your plugins: [
{ src: '~/plugins/vue-stack-grid', mode: 'client' }
] Seems to have worked for me at least. |
I was able to get the component imported by using @guastallaigor's workaround. However, I am seeing some odd behaviour: Any ideas of what to take a look at to debug? |
Getting this error when using Nuxt.js.
The component is wrapped in a client-only tag to avoid any SSR issues.
Error screenshot:
Implementation:
In component
Component registration
The text was updated successfully, but these errors were encountered: