QwikCommunity / pwa

Turn your Qwik Application into an offline compatible PWA
https://pwa-a3b.pages.dev/
89 stars 6 forks source link

error during build: Error: ENOENT: no such file or directory, #16

Open manuelsanchez2 opened 4 months ago

manuelsanchez2 commented 4 months ago

Hi! I have followed all the steps, but when trying to run the build command, I get this error from the server one.

error during build:
Error: ENOENT: no such file or directory, open '/Users/ManuSanchez/ALL_DOCUMENTS/CODING/PROJECTS/manuelsanchezweb/2024/qwik-calendar/dist/service-worker.js'

Do you have an idea of why and what I could do to solve this issue? Thanks in advance!

userquin commented 4 months ago

where is the qwik pwa plugin in Vite config?

manuelsanchez2 commented 4 months ago

My config is like this:

import { defineConfig } from 'vite';
import { qwikVite } from '@builder.io/qwik/optimizer';
import { qwikCity } from '@builder.io/qwik-city/vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { qwikPwa } from "@qwikdev/pwa";

export default defineConfig(() => {
  return {
    plugins: [qwikCity(), qwikVite(), tsconfigPaths(), qwikPwa()],
    preview: {
      headers: {
        'Cache-Control': 'public, max-age=600',
      },
    },
  };
});

And what is failing the build.server command that uses vercel adaptor. "build.server": "vite build -c adapters/vercel-edge/vite.config.ts",

If you want to take a better look, whole code is to be found here:

https://github.com/manuelsanchezweb/qwik-calendar/pull/23

bogdan-nita commented 3 months ago

ran into the same issue, is there any fix available?