Home

Issue: 2949

Can't import Nuxt Link in SSR mode

[issue link]

I need to import NuxtLink in my project; but it doesn’t work in Nuxt when it’s rendered on the server.

My page is

<template>
  <h1>Hello world!</h1>
</template>
<script>
import NuxtLink from 'nuxt/lib/app/components/nuxt-link'

console.log(NuxtLink)
</script>

It works in SPA mode; but I get the following warning:

17:2-16 "export 'default' (imported as '__vue_script__') was not found in '!!babel-loader?{"babelrc":false,"cacheDirectory":true,"presets":[["/app/node_modules/babel-preset-vue-app/dist/index.common.js",{"targets":{"ie":9,"uglify":true}}]]}!../node_modules/vue-loader/lib/selector?type=script&index=0!./index.vue'

However; in SSR mode I get the following error:

screenshot 2018-03-05 10 36 25
This question is available on Nuxt.js community (#c2557)