1

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

In bun run dev, all fine

In bun run build and npx serve .output/public (also, if you upload to the server, the result is the same). Nuxt loader instead of response

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.

0 Answers0