I just make the nuxt 3 app with graphql. Although in development mode everything works fine, in production there is such a problem: instead of response to any request to api (and not only) comes the nuxt loader code. See the screenshots
Nuxt loader instead of hook.js (part 1)
Nuxt loader instead of hooks.js (part 2)
My nuxt.config.ts
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
sourcemap: {
server: true,
client: true
},
ssr: false,
nitro: {
preset: 'service-worker'
},
build: {
transpile: ["primevue"]
},
modules: [
// ...
'@pinia/nuxt',
'@nuxtjs/apollo',
'vue3-carousel-nuxt',
],
devtools: { enabled: true },
pinia: {
autoImports: [
// automatically imports `defineStore`
'defineStore', // import { defineStore } from 'pinia'
['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
],
},
apollo: {
autoImports: true,
authType: 'Session',
authHeader: 'woocommerce-session',
tokenStorage: 'cookie',
tokenName: 'woocommerce-session',
clients: {
default: {
httpEndpoint: 'https://ojuvi.by/api/graphql',
},
},
},
css: ["~/public/css/style.less"],
});
I don't understand what's wrong, I've tried googling but I can't find anything like that.