You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the error overlay shows some errors on the wrong line if i try to access a property of an undefined variable. I noticed it with the new beta but it is also reproducible in 1.9.0. Below you can see the component with an error in line 7 and in the error the line 15 is referenced.
Hope this helps. I can not investigate as I dont even know which part of the pipeline/code generates the error (dont even know if it is an astro bug).
---const test =undefined---
<html>
<main>
<p>{test.variable}</p> // Error should be in this line
</main>
</html>
<style>
main {
margin: auto;
padding: 1.5rem;
max-width: 60ch;
}
</style>
error Cannot read properties of undefined (reading 'variable')
File:
/home/projects/github-tinlly/src/pages/index.astro:15:36
Code:
14 | padding: 1.5rem;
> 15 | max-width: 60ch;
| ^
16 | }
17 | </style>
Stacktrace:
TypeError: Cannot read properties of undefined (reading 'variable')
at eval (/home/projects/github-tinlly/src/pages/index.astro:15:36)
at Module.renderPage (file://file:///home/projects/github-tinlly/node_modules/astro/dist/runtime/server/render/page.js:104:36)
at Module.renderPage (file://file:///home/projects/github-tinlly/node_modules/astro/dist/core/render/core.js:103:51)
at async Module.renderPage (file://file:///home/projects/github-tinlly/node_modules/astro/dist/core/render/dev/index.js:123:10)
at async Module.handleRoute (file://file:///home/projects/github-tinlly/node_modules/astro/dist/vite-plugin-astro-server/route.js:168:20)
at async run (file://file:///home/projects/github-tinlly/node_modules/astro/dist/vite-plugin-astro-server/request.js:62:14)
at async Module.runWithErrorHandling (file://file:///home/projects/github-tinlly/node_modules/astro/dist/vite-plugin-astro-server/controller.js:83:5)
at async Module.handleRequest (file://file:///home/projects/github-tinlly/node_modules/astro/dist/vite-plugin-astro-server/request.js:56:3)
What version of
astro
are you using?1.9.0
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the Bug
I noticed that the error overlay shows some errors on the wrong line if i try to access a property of an undefined variable. I noticed it with the new beta but it is also reproducible in 1.9.0. Below you can see the component with an error in line 7 and in the error the line 15 is referenced.
Hope this helps. I can not investigate as I dont even know which part of the pipeline/code generates the error (dont even know if it is an astro bug).
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-tinlly?file=src%2Fpages%2Findex.astro&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: