Nuxt не отвечают роуты (404), кроме главной страницы?
Всем доброго дня.
Если переходить по роутам внутри приложения, начиная с главной страницы http://localhost:3000/, то страницы-роуты открываются нормально. Но если перейти по прямой ссылке (например, http://localhost:3000/docs), то страница долго не отвечает, а после в отладчике возвращает ошибку:
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
Failed to load resource: the server responded with a status of 404 (Cannot find any path matching /docs.)
nuxt.config.js:
import graphql from '@rollup/plugin-graphql';
export default defineNuxtConfig({
app: {
head: {
title: 'Site',
htmlAttrs: {
lang: 'ru'
},
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],
script: [],
link: [],
style: []
},
},
build: {
transpile: [
'@nuxtjs/apollo',
'tslib',
],
analyze: true,
},
nitro: {
esbuild: {
options: {
target: 'esnext',
},
},
prerender: {
crawlLinks: false,
routes: ['/'],
ignore: ['/hi'],
},
},
modules: [
'@nuxtjs/apollo',
'@pinia/nuxt',
'@nuxt/image',
'nuxt-mdi'
],
image: {
inject: true
},
plugins: [
{ src: '~/plugins/ymapPlugin.js', mode: 'client' },
{ src: '~/plugins/apollo.js', mode: 'client' },
],
apollo: {
autoImports: true,
authType: 'Bearer',
authHeader: 'Authorization',
tokenStorage: 'cookie',
clients: {
default: {
tokenStorage: 'cookie',
httpEndpoint: process.env.NODE_ENV ==='production' ? `https://www.test-site/graphql` : 'http://localhost:3001/graphql'
},
},
},
pinia: {
autoImports: [
'defineStore',
['defineStore', 'definePiniaStore'],
],
},
css: [
'@/assets/styles/media.scss',
'@/assets/styles/main.scss',
'@/assets/styles/fonts/Montserrat.css',
],
vite: {
plugins: [graphql()],
},
})
В чем может быть причина такого поведения?