Skip to content
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

Failed to load config v0.2.1 #46

Open
nicodes opened this issue Apr 28, 2023 · 3 comments
Open

Failed to load config v0.2.1 #46

nicodes opened this issue Apr 28, 2023 · 3 comments

Comments

@nicodes
Copy link

nicodes commented Apr 28, 2023

I'm getting an error when using this package "@vite-pwa/sveltekit": "0.2.1" with a freshly created project using "@sveltejs/kit": "^1.5.0". Can anyone please let me know if these versions are incompatible?

I have setup the basic config file following the documentation describes:

import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { SvelteKitPWA } from '@vite-pwa/sveltekit';

export default defineConfig({
	plugins: [sveltekit(), SvelteKitPWA()]
});

Below is the run time error:

failed to load config from /Users/.../sveltekit-app/vite.config.ts
error when starting dev server:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite-plugin-pwa' imported from /Users/.../sveltekit-app/node_modules/@vite-pwa/sveltekit/dist/index.mjs
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:852:9)
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1115:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:837:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36)
error Command failed with exit code 1.
@nicodes nicodes changed the title Failed to load config v0.2.0 Failed to load config v0.2.1 Apr 28, 2023
@rbozan
Copy link

rbozan commented May 2, 2023

Weirdly enough I had the same but I figured out it was because I used yarn instead of npm install in my NPM project .. Not sure if some new pkg update which yarn did not follow broke anything, but at least it works now for me.

@j-tai
Copy link

j-tai commented May 5, 2023

Yeah, it's caused by installing @vite-pwa/sveltekit using yarn instead of npm.

Workaround: yarn add -D vite-plugin-pwa

@nicodes
Copy link
Author

nicodes commented Jun 10, 2023

@rbozan @j-tai I used pnpm but the docs say it's supported https://vite-pwa-org.netlify.app/frameworks/sveltekit.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants