-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InjectManifest The 'swSrc' file can't be read. ENOENT: no such file or directory
error on Gitlab CI
#66
Comments
@haleksandre have you configured kit sw entry? https://vite-pwa-org.netlify.app/frameworks/sveltekit.html#generate-custom-service-worker Latest kit pwa plugin version will delegate sw build to kit, and so you need to configure |
Yes, my import adapter from "@sveltejs/adapter-node";
import preprocess from "svelte-preprocess";
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
adapter: adapter({ out: "dist" }),
env: {
publicPrefix: "API_URL",
},
serviceWorker: {
register: false,
},
files: {
serviceWorker: "src/sw.ts",
},
csrf: {
checkOrigin: process.env.NODE_ENV !== "development",
},
},
};
export default config; It is peculiar that everything is building fine on my local using the exact same configs, files within the same image, and environment variables, but fails in the GitLab CI. |
Can you show the gh pages output/dist folder? |
Check if the output folder inside .sveltekit contains service-woker.js or sw.js (ot seems former is missing) |
Turns out it was indeed an error caused by an environment variable. I did not realize that I had forgotten to add a Anyways, thanks for taking the time to help me troubleshoot this issue. 👍 |
Hi,
I am able to build the Sveltekit app successfully in my local environment (using podman with image node:18), but when I run the build command from within a Gitlab-CI runner using the same image (node:18) running the exact same commands I get the following error, after building the ssr bundle, when it's building client-side files. It instantly fails with the following error.
It might be a Vite/Sveltekit issue? It seems like Vite/Sveltekit doesn't load the configs for the client-side bundling, so Sveltekit doesn't create the
.svelte-kit/output/client
directory & then VitePWA errors for the directory not found?The text was updated successfully, but these errors were encountered: