Skip to content
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

Incorrect TS error on Astro.redirect #11168

Closed
gersomvg opened this issue May 31, 2024 · 1 comment
Closed

Incorrect TS error on Astro.redirect #11168

gersomvg opened this issue May 31, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@gersomvg
Copy link

gersomvg commented May 31, 2024

Astro Info

Astro                    v4.9.2
Node                     v20.12.2
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/tailwind

Describe the Bug

---
const route = '/page-a';
return Astro.redirect(route, 307);
---

Hello world!

Gives this error when using @astrojs/check:

src/pages/index.astro:4:7 - error ts(6133): 'route' is declared but its value is never read.

4 const route = '/page-a';
        ~~~~~

What's the expected result?

To not get this TS warning. I'm using strictest tsconfig which means this is an error and it prevents me from running astro build unless I'm disabling TS checks.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-us5tdu?file=src%2Fpages%2Findex.astro

(open new terminal and type npx astro check)

@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 31, 2024
@Princesseuh
Copy link
Member

Duplicate of withastro/language-tools#476

@Princesseuh Princesseuh marked this as a duplicate of withastro/language-tools#476 May 31, 2024
@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants