#Cannot read properties of null (reading 'default')

8 messages · Page 1 of 1 (latest)

robust yoke
#

Hello everyone,

I am facing the following super wierd error:

 error   Cannot read properties of null (reading 'default')
  File:
    /Users/me/Dev/Ruxiom/astro_blog/src/pages/index.astro:1:1
  Code:
    > 1 | ---
        | ^
      2 | import BaseLayout from "@layouts/BaseLayout.astro";
      4 | import Landing from "@components/Landing.astro";
  Stacktrace:
TypeError: Cannot read properties of null (reading 'default')

The only thing I changed is that I created an Layout (named BaseLayout) in src/layouts/BaseLayout.astro because our blog our site is needing some extra pages, so that I dont have to copy and paste that often.

Does anybody have a clue what could be happening here, as the error does not say me anything.

I am on astro 3.1.0.

Thanks in advance,
David

already restarted TS, IDE and reloaded Astro projects

robust yoke
#

for reference this is my index.astro:

---
import BaseLayout from "@layouts/BaseLayout.astro";

import Landing from "@components/Landing.astro";
import About from "@components/About.astro";
import Price from "@components/Price.astro";
import Kontakt from "@components/Kontakt.astro";

import "@styles/base.css";
---

<BaseLayout>
  <slot>
    <Landing />
    <About />
    <Price />
    <Kontakt />
  </slot>
</BaseLayout>
#

and if it is happening because of my alias, this is my tsconfig.json:

{
  "extends": "astro/tsconfigs/strictest",
  "compilerOptions": {
    "baseUrl": "src/",
    "paths": {
      "@components/*": ["components/*"],
      "@assets/*": ["assets/*"],
      "@layouts/*": ["layouts/*"],
      "@styles/*": ["styles/*"]
    }
  }
}

tardy cipher
#

does it work without the aliases?

robust yoke
#

let me try 🙂

robust yoke
tardy cipher
#

is this project public? or are you able to create a minimal reproduction?

robust yoke
#

project is private but i'll try to create a simple reproduction on stackblitz.