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

rootDirs and SvelteKit #26871

Open
nshiab opened this issue Nov 14, 2024 · 1 comment
Open

rootDirs and SvelteKit #26871

nshiab opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
feat new feature (which has been agreed to/accepted) tsc related to the TypeScript tsc compiler

Comments

@nshiab
Copy link

nshiab commented Nov 14, 2024

deno 2.0.6 (stable, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2

Hi,

I am using SvelteKit and I am trying to reproduce this example:

import type { PageLoad } from './$types';

export const load: PageLoad = async ({ fetch, params }) => {
	const res = await fetch(`/api/items/${params.id}`);
	const item = await res.json();

	return { item };
};

But I have this error:
Screenshot 2024-11-14 at 9 53 54 AM

From what I understand, it's maybe because the default SvelteKit tsconfig.json has the rootDirs options set to ["..", "./types"] but this is not supported by Deno and/or the Deno VSCode extension.

{
  "extends": "./.svelte-kit/tsconfig.json",
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "rootDirs": ["..", "./types"]
  }
  // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
  // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
  //
  // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
  // from the referenced tsconfig.json - TypeScript does not merge them in
}

Thank you!

@bartlomieju
Copy link
Member

@nayeemrmn is already working on this

@bartlomieju bartlomieju added feat new feature (which has been agreed to/accepted) tsc related to the TypeScript tsc compiler labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted) tsc related to the TypeScript tsc compiler
Projects
None yet
Development

No branches or pull requests

3 participants