Can't get it to work in NuxtJS
See original GitHub issueThis is probably just a configuration error, but seeing that #15 isn’t related I thought I might open a new one. I have added slate-vue
to my Nuxt project and enabled the plugin in nuxt.config.js
.
// plugins/vue-slate.js
import Vue from 'vue'
import { SlatePlugin } from 'slate-vue'
Vue.use(SlatePlugin)
// nuxt.config.js
{
build: {
transpile: ['slate-vue']
},
plugins: ['~/plugins/vue-slate.js'],
}
I still experience the Unexpected token 'export'
error. That’s why I added the package to the transpile key in the first place. As soon as I remove the plugin file reference from the plugins
array, the website loads fine.
Edit: I’ve uploaded the project: https://github.com/SirWindfield/zt-write. It’s basically just the default template (yarn create nuxt-app zt-write
) with slate-vue
added and configured.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cannot get Nuxt.js, Express, and 3rd-party API to work together
I have been trying for weeks to get Nuxt.js + Express (using create-nuxt-app ) to work with a 3rd-party API. No matter what...
Read more >Nuxtjs Documentation cant get it to work · Issue #2659 - GitHub
After following the guide on how to set up nuxtjs + netlify-cms i will get the ERROR Could not resolve routes when running...
Read more >Installation - Nuxt
Another way to get started with Nuxt is to use CodeSandbox which is a great way for quickly playing around with Nuxt and/or...
Read more >Vuex: support doesn't work with Nuxt.js project structure
Go to pages/index.vue and command+click on 'changeData' on line 40. This should take you to store/index.js line 15. Furthermore in store ...
Read more >Can't get Laravel Sanctum and NuxtJs to work - Laracasts
Can't get Laravel Sanctum and NuxtJs to work · The setup uses Laravel Valet . · The Laravel Application runs at https://sanctum.test ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have done some tests and found the problem. The module for tsx support:
vue-tsx-support@3.1.0
only has ES6 dist version. Just add it to transpile option like :build: { transpile: ['slate-vue', 'vue-tsx-support'] }
JFYI, you can get this to work with SSR (and e.g. the static target) when wrapping the
<Slate>
component in<client-only>
in order to bypass prerendering for this specific part of the code. https://nuxtjs.org/docs/features/nuxt-components/#the-client-only-component