EmilTholin / svelte-routing

A declarative Svelte routing library with SSR support
MIT License
2.02k stars 178 forks source link

"Cannot find module 'svelte-routing' or its corresponding type declarations" error on versions 2.7.0+ #273

Closed xale-a closed 10 months ago

xale-a commented 10 months ago

image

I've tried all versions from 2.6.0 to 2.9.0, version 2.6.0 doesn't show the error, but all ones after it have it.

I'm using this dependencies:

"devDependencies": {
    "@sveltejs/vite-plugin-svelte": "^2.4.2",
    "autoprefixer": "^10.4.16",
    "postcss": "^8.4.31",
    "svelte": "^4.0.5",
    "svelte-routing": "^2.9.0",
    "tailwindcss": "^3.3.5",
    "vite": "^4.4.5"
},

And this jsconfig:

{
  "compilerOptions": {
    "moduleResolution": "bundler",
    "target": "ESNext",
    "module": "ESNext",
    /**
     * svelte-preprocess cannot figure out whether you have
     * a value or a type, so tell TypeScript to enforce using
     * `import type` instead of `import` for Types.
     */
    "verbatimModuleSyntax": true,
    "isolatedModules": true,
    "resolveJsonModule": true,
    /**
     * To have warnings / errors of the Svelte compiler at the
     * correct position, enable source maps by default.
     */
    "sourceMap": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    /**
     * Typecheck JS in `.svelte` and `.js` files by default.
     * Disable this if you'd like to use dynamic types.
     */
    "checkJs": true
  },
  /**
   * Use global.d.ts instead of compilerOptions.types
   * to avoid limiting type declarations.
   */
  "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}

Also, please note that setting moduleResolution to node fixes the issue, but I don't know if that makes sense, since I'm not using node for my app (it's meant to be static SPA app with Django as a backend).

krishnaTORQUE commented 10 months ago

@tbxMb & @kevin82222

PR https://github.com/EmilTholin/svelte-routing/pull/272

PR https://github.com/EmilTholin/svelte-routing/pull/266

Those 2 PR & fixes does not looks like fixed yet.

Could you guys please have a look if you have time.

Thanks

krishnaTORQUE commented 10 months ago

Issue fixed in v2.10.0