Getting this error in files where I am using $app/navigation:Error: Failed to resolve import "$app/navigation" from "src/utils/navigationUtils.js". Does the file exist?
.
Here is my setupTests.js file but now getting the same error in this file.
import "@testing-library/jest-dom";import { vi } from "vitest";import * as navigation from "$app/navigation";// Mock SvelteKit runtime module $app/navigationvi.mock("$app/navigation", () => ({ afterNavigate: () => {}, beforeNavigate: () => {}, disableScrollHandling: () => {}, goto: () => Promise.resolve(), invalidate: () => Promise.resolve(), invalidateAll: () => Promise.resolve(), prefetch: () => Promise.resolve(), prefetchRoutes: () => Promise.resolve(),}));
After this configration now getting:Error: Failed to resolve import "$app/navigation" from "setupTests.js". Does the file exist?
I have tried to mock the $app/navigation
module in setupTests.js file but no success.