Bug 馃悶
From a fresh installation on nuxt, an "Unexpected token export" error is thrown immediately when adding the vue-instantsearch plugin to the nuxt configuration file.
https://codesandbox.io/s/github/TateB/nuxt-error/tree/master/
The plugin should be able to be initialised without any errors. It happens all the time.
Version 2.0.0
@TateB, you need to set the dependencies to be transpiled correctly:
You're correct that this is missing in the docs, seems like I forgot to paste it in from the draft version.
I just made a patch for this in the docs. The docs team are currently doing a big refactor however, so it might not immediately be merged.
Have a nice day!
@TateB, you need to set the dependencies to be transpiled correctly:
vue-instantsearch/examples/nuxt/nuxt.config.js
Lines 4 to 6 in afc7d76
build: {
transpile: ['vue-instantsearch', 'instantsearch.js/es'],
},
You're correct that this is missing in the docs, seems like I forgot to paste it in from the draft version.
many thanks.
It's July 2020 and I still had to add this fix to get a fresh install working.
A fresh installation with no dependencies giving this error.
A fresh installation with no dependencies giving this error.
fix: build: {
transpile: [ ]
}
I also just ran into this issue... :/
Sorry, that's an issue on Nuxt's side, there's nothing wrong with transpiling, but there's no way for us to tell Nuxt it _should_ be added from our side
@TateB, you need to set the dependencies to be transpiled correctly:
You're correct that this is missing in the docs, seems like I forgot to paste it in from the draft version.
after adding this line, 'npm run dev' works fine, untill I run 'npm run build' again. After that, error again shows up on 'npm run dev'. Any ideas? Anyone else getting same issue?
hm, I don't have that on our demos @yog3sha, maybe try removing the cache directories? If you have a GitHub repo with reproduction I can look into it
@yog3sha
I have exactly the same problem. Did you find a solution?
just add ssr: false for plugin
{ src: '@/plugins/components.js' ,ssr: false},
add this code to build nuxt config
build: {
transpile: ['@stylelib']
},
Most helpful comment
@TateB, you need to set the dependencies to be transpiled correctly:
https://github.com/algolia/vue-instantsearch/blob/afc7d76c7c47b562948e10dd023049175ee35d6b/examples/nuxt/nuxt.config.js#L4-L6
You're correct that this is missing in the docs, seems like I forgot to paste it in from the draft version.