#Cannot find module '../layouts/Layout.astro' or its corresponding type declarations.

2 messages · Page 1 of 1 (latest)

sly fable
#

why vs code is giving me this error .

//astro.config.mjs

import { defineConfig } from 'astro/config';
import react from '@astrojs/react';

// https://astro.build/config
export default defineConfig({
    // Enable Astro to support React JSX components.
    integrations: [react()],
});
//tsconfig.json
{
  "compilerOptions": {
      "jsx": "react"
    
  },
  "extends": "astro/tsconfigs/base"
}```


// layout.astro

const title = Astro.props;

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
</body>
</html>


// index.astro

import Layout from "../layouts/Layout.astro";

<Layout title="Welcome to Astro.">
<main>
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
<p class="instructions">
To get started, open the directory <code>src/pages</code> in your project.<br
/>
<strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
</p>
</main>
</Layout>

copper escarp
#

try resting the typescript server