Skip to content

VS Code only shows types if TypeScript is installed #4267

@robots4life

Description

@robots4life

Describe the bug

Cannot find module '$app/navigation' or its corresponding type declarations. It seems goto cannot be used or something is off with $app/navigation.

Reproduction

https://github.com/robots4life/goto

npm list @sveltejs/kit => [email protected] /shared/httpd/goto └── @sveltejs/[email protected]

src/routes/index.svelte

<script>
    import {goto} from '$app/navigation';
	// Cannot find module '$app/navigation' or its corresponding type declarations.js(2307)

    goto('/profile');
</script>

<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

svelte.config.js

import adapter from '@sveltejs/adapter-auto';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter(),
	}
};

export default config;

System Info

Linux

System:
    OS: Linux 5.4 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 2.44 GB / 15.53 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 16.14.0 - /opt/nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 8.3.1 - /opt/nvm/versions/node/v16.14.0/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.31 
    @sveltejs/kit: next => 1.0.0-next.294 
    svelte: ^3.44.0 => 3.46.4

Windows

System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 8.69 GB / 15.80 GB
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (99.0.1150.30)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.31
    @sveltejs/kit: next => 1.0.0-next.294
    svelte: ^3.44.0 => 3.46.4

Severity

blocking all usage of SvelteKit

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions