question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get it to work in NuxtJS

See original GitHub issue

This 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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
marsprincecommented, Jan 29, 2021

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'] }

0reactions
rxstocommented, Sep 29, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found