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

Sveltekit #78

Open
aubelsb2 opened this issue Aug 2, 2022 · 1 comment
Open

Sveltekit #78

aubelsb2 opened this issue Aug 2, 2022 · 1 comment

Comments

@aubelsb2
Copy link

aubelsb2 commented Aug 2, 2022

Is this known to work with sveltekit? I am getting module issues importing:

const {sveltekit} = require('@sveltejs/kit/vite');

using:

const playwrightShooter = require("viteshot/shooters/playwright");
const playwright = require("playwright");
const path = require("path")
const {sveltekit} = require('@sveltejs/kit/vite');
const vite = require("vite");

module.exports = {
    framework: {
        type: "svelte",
    },
    shooter: playwrightShooter(playwright.chromium),
    filePathPattern: "**/*.screenshot.@(js|jsx|tsx|vue|svelte)",
    vite: vite.defineConfig({
        resolve: {
            alias: {
                '$components': path.resolve('./src/components'),
                '$services': path.resolve("./src/services"),
                '$global': path.resolve("./src/global"),
                '$root': path.resolve("./src"),
            }
        },
        plugins: [
            sveltekit(),
        ],
    })
};

Or if I don't use that I get issues with $app

Failed to resolve import "$app/env" from "src\services\stores\user.ts". Does the file exist?
1:55:35 pm [vite] Internal server error: Failed to resolve import "$app/env" from "src\services\stores\user.ts". Does the file exist?
  Plugin: vite:import-analysis
  File: src/services/stores/user.ts
  1  |  import { writable } from "svelte/store";
  2  |  import { browser } from "$app/env";
     |                           ^
  3  |  const createWritableStore = (key, startValue) => {
  4  |    const { subscribe, set } = writable(startValue);

@fwouts
Copy link
Owner

fwouts commented Aug 3, 2022

Hi @aubelsb2, I haven't tried it with SvelteKit.

I'm not actively working on this project at the moment but feel free to send a PR if you figure out what's missing! It might just be a few dependencies needing to be upgraded.

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

2 participants