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
Adding Scripts Affects TypeScript Intellisense on .astro
file
#800
Comments
Please share the file, we cannot help without a reproduction. Doesn't need to be the full project. |
Hello @iamhectorsosa. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Hey, @Princesseuh Would a gist work? https://gist.github.com/iamhectorsosa/08413ed27b3c0ffad0d64096d608d706 |
You know what's interesting, if I go ahead and follow the instructions of import local scripts, then this issue goes away. <script is:inline src="./theme.js"></script> Still I am not sure what might be causing this. It's such a strange behavior. I wish I could help more. |
Yes, that's perfect, thank you! |
I'm not quite sure what the exact cause is, but you can workaround the issue by putting the script tag below the content. |
Thanks for looking into it. Yeah, also importing works for this. Still a strange issue. |
I just experienced a similar case: <script is:inline>
// interepreted as js, no issue
let a
</script> ---
const data = {
foo: "bar"
}
---
<script is:inline>
// interepreted as ts, complains
let a
</script> ---
const data = {
foo: "bar"
}
---
<div></div>
<script is:inline>
// interepreted as js, no issue
let a
</script> |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Adding Scripts Affects TypeScript Intellisense on
.astro
file. The snippet below has been included in Layout.astro or index.astro files. In both situations with or without directives I've noticed that the TypeScript intellisense is completely disabled. Missing imports are not detected, no intellisense on any props for the imported components, etc.What's the expected result?
TypeScript is not affected by the inclusion of script tags in
.astro
filesLink to Minimal Reproducible Example
I don't have a GitHub repo at the time with this.
Participation
The text was updated successfully, but these errors were encountered: