Closed MoustaphaDev closed 9 months ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
speed-insights-astro | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Feb 14, 2024 4:30pm |
speed-insights-nextjs | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Feb 14, 2024 4:30pm |
speed-insights-nuxt | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Feb 14, 2024 4:30pm |
speed-insights-remix | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Feb 14, 2024 4:30pm |
speed-insights-sveltekit | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Feb 14, 2024 4:30pm |
speed-insights-vue | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Feb 14, 2024 4:30pm |
Would love if you can have a look at this @tobiaslins (or any other maintainer)!
Would love if you can have a look at this @tobiaslins (or any other maintainer)!
Second this
Hello @MoustaphaDev, and thanks for your contribution!
I'm annoyed, because I can't reproduce your error on the main branch.
The hack implemented #41 comes from the Astro core team (see the PR desc for an explanation). Let's try your fix. I'll release it, and we'll revert in case we receive some bug reports from other Astro users.
@MoustaphaDev , @rochajulian, I've released 1.0.10. Please try it out and let us know.
I'm so confused as well, now I can't even reproduce this error anymore with 1.0.9. The Astro language server and typescript plugin were updated yesterday, so I suspect that might have helped solve the problem. 1.0.10 is working as well. I guess reverting when we find any bug, as you said, would be best π€·ββοΈ
π What's in there?
Fixes https://github.com/vercel/speed-insights/issues/54. The
types
field of theastro
export didn't point to any existing file, so it couldn't be resolved. I'm not sure why the fix in https://github.com/vercel/speed-insights/pull/41 supposedly worked for some people, but this should hopefully fix it for everyone.π§ͺ How to test?
This should work now, but before it caused an error
Before
```sh > astro "check" 22:55:55 Types generated 473ms 22:55:55 [check] Getting diagnostics for Astro files in /home/coding/speed-insights/apps/astro... src/components/BaseHead.astro:5:27 - error ts(2307): Cannot find module '@vercel/speed-insights/astro' or its corresponding type declarations. 5 import SpeedInsights from '@vercel/speed-insights/astro'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/components/BaseHead.astro:49:12 - warning ts(6133): 'speedInsightsBeforeSend' is declared but its value is never read. 49 function speedInsightsBeforeSend(data){ ~~~~~~~~~~~~~~~~~~~~~~~ Result (14 files): - 1 error - 0 warnings - 1 hint ```After
```sh > astro "check" 22:58:46 Types generated 425ms 22:58:46 [check] Getting diagnostics for Astro files in /home/coding/speed-insights/apps/astro... src/components/BaseHead.astro:49:12 - warning ts(6133): 'speedInsightsBeforeSend' is declared but its value is never read. 49 function speedInsightsBeforeSend(data){ ~~~~~~~~~~~~~~~~~~~~~~~ Result (14 files): - 0 errors - 0 warnings - 1 hint ```The type error was also surfaced in the IDE, but it's resolved fine now
Before
![Screenshot from 2024-02-12 23-54-35](https://github.com/vercel/speed-insights/assets/81974850/2a39e13c-c6f0-47a5-b9e7-9b98299b9053)After
![Screenshot from 2024-02-13 01-27-43-edit](https://github.com/vercel/speed-insights/assets/81974850/2460cb3e-3532-4914-b5fd-2b588b8d710b)