microsoft / microsoft/TypeScript
Assigning window.location after 5.8.2 upgrade fails
Aberta
@sandersn já está trabalhando nisso.
Desde 3/3/2025.
Needs Investigation
- Linguagem predominante
- Go
- Estrelas
- 111k
- Forks
- 14.3k
- Merge médio
- 2d 4h
- PRs com merge (30d)
- 132
Descrição
🔎 Search Terms
Unable to assign window.location typescript 5.8.2
error TS2322: Type 'Location' is not assignable to type 'string & Location'.
Type 'Location' is not assignable to type 'string'.
🕗 Version & Regression Information
- This changed between versions 5.7.3 and 5.8.2
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.8.2#code/O4SwdgJg9sB0A2UDGBDALiKYAEBebokMCy6mYA3AFBA
💻 Code
window.location = window.location;
🙁 Actual behavior
Failing with error:
error TS2322: Type 'Location' is not assignable to type 'string & Location'.
Type 'Location' is not assignable to type 'string'.
🙂 Expected behavior
Expect it to either be a documented breaking change, OR it should continue to work as it did in 5.7.3:
https://www.typescriptlang.org/play/?ts=5.7.3#code/O4SwdgJg9sB0A2UDGBDALiKYAEBebokMCy6mYA3AFBA
Additional information about the issue
No response
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Avaliação
Esta issue ainda não foi avaliada.