Skip to content

Imported routes from vue-router/auto-routes is undefined #349

Closed Answered by hc-chumak
negezor asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

@negezor, try to use ssr.noExternal option for development mode in defineConfig:

import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import VueRouter from 'unplugin-vue-router/vite'

export default ({ mode }) => {
  return defineConfig({
    ssr: {
      noExternal: mode === 'development' ? ['vue-router'] : []
    },
    plugins: [
      VueRouter(),
      Vue()
    ]
  })
}

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@negezor
Comment options

@posva
Comment options

Comment options

You must be logged in to vote
2 replies
@negezor
Comment options

@posva
Comment options

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #348 on March 24, 2024 09:02.