We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
"property does not exist", "property does not exist under if statement", "property not allowed after if statement excluding it"
https://www.typescriptlang.org/play/?ts=5.9.0-dev.20250318#code/MYewdgzgLgBAsgeQCIFUAyBRA+gYQQOQDEBJAcRgF4YBvAKBhlDCgFNmAuG+hx8V5rBGAAnAJYAHKBE50ePALYBDKMAAWLaTADaAclVQo49gHpjAKnM6ANDD0Hx00xbPXbAHkUAbT1gCuwzwgAPh0AXStuOQArTS0AAyZ+KGNRMAATFgAPADpRUQAzFmyYuPDImABfCIYq2gqYRQheSCgAblpaJmgYJAxCAEF0ABVcAAkEYhwMAGVKbW5qGDBFeRZOHRw+NlhpkQlYAAoMTJZgX1YYAClZ8BgAdRYAIxgABUUAcxYASlcANy9fGtbIltjpKtUaEsVkCNltmDBdmJJDAAEq+ZiiVYwA7EMBRU6wa4wW7TcSnAqiYAwfrAKCicBNTyiADWLFeIHEvnEMBwTOAzJ+Nn+nkB6xBzAAtMJ0XTVmDaqEGk0um0OllxCBhLAoABPMnwEBpXyeFj4aFDPVsqgHXVkkD5Hp9QZoEY4caTGZfLRgXzyR4sYShXTCwFhdq0dWa2AqmBZFbiE1zRo6sBUg7ceSG42m6GcOBZk1m1YWskRL6UIJcBgFbGZo2F6HZaCKLUQO6iKCqA46cVQHRfcuyHg1g517NFq0UKg9uFQKUyzEsftVuQwUwwUYYFEYHSzIabmAYfBIGAIQgwfcYGBoYgANSvZ+Bs-nGLlNgAQighhfZkgEDN8B0IZtzwUh8GIAAtK9iG-Yh8EPNBpivaYhn6IYMDgI8hnKBhhBYKB-DAdo5Aqbh6hYQI2SHBh10-b9L23XdqXgrcUQQFFyi6EATWyTwQHeA5EFQTBcAIEhSC0McG1WUIvg6OR12IGB8AwDATyGBBXjQfophgGDygKUcCxzLEAEIpyfZhthfWUly+ajVy4ni+IEoT0GwPAiDISTjInWTylIhTjFPDigpgAABKQJXVAlouEYRNRwngnKKFzBOQdzRK8iSpJMlh-JqeTmggbjUv4g44iQCj8JYNJOAAEmoXKJwqOIvnaCpwzjeQExYbtexsxd+1aIA
Code is very, very simple, let's look on playground
TS2551: Property content-runtime does not exist on type
Not occur, because of part TS complaining about, not exists on else statement at all.
else
The text was updated successfully, but these errors were encountered:
startsWith doesn't participate in narrowing out of the box. If you want this, you can add it yourself:
startsWith
declare global { interface String { startsWith<K extends string>(searchString: K): this is `${K}${string}` } }
This will fix your example.
Sorry, something went wrong.
startsWith doesn't participate in narrowing out of the box. If you want this, you can add it yourself: declare global { interface String { startsWith(searchString: K): this is ${K}${string} } } This will fix your example.
declare global { interface String { startsWith(searchString: K): this is ${K}${string} } } This will fix your example.
${K}${string}
Thanks, but it looks like overkill, for my problem, i mean that should work with native solution.
Why it doesn't work and have you plan to implement solution for this?
Ahh, I found the original. Duplicate of #46958; search terms startsWith in:title.
startsWith in:title
have you plan to implement solution for this?
See #46958 (comment)
No branches or pull requests
🔎 Search Terms
"property does not exist", "property does not exist under if statement", "property not allowed after if statement excluding it"
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.9.0-dev.20250318#code/MYewdgzgLgBAsgeQCIFUAyBRA+gYQQOQDEBJAcRgF4YBvAKBhlDCgFNmAuG+hx8V5rBGAAnAJYAHKBE50ePALYBDKMAAWLaTADaAclVQo49gHpjAKnM6ANDD0Hx00xbPXbAHkUAbT1gCuwzwgAPh0AXStuOQArTS0AAyZ+KGNRMAATFgAPADpRUQAzFmyYuPDImABfCIYq2gqYRQheSCgAblpaJmgYJAxCAEF0ABVcAAkEYhwMAGVKbW5qGDBFeRZOHRw+NlhpkQlYAAoMTJZgX1YYAClZ8BgAdRYAIxgABUUAcxYASlcANy9fGtbIltjpKtUaEsVkCNltmDBdmJJDAAEq+ZiiVYwA7EMBRU6wa4wW7TcSnAqiYAwfrAKCicBNTyiADWLFeIHEvnEMBwTOAzJ+Nn+nkB6xBzAAtMJ0XTVmDaqEGk0um0OllxCBhLAoABPMnwEBpXyeFj4aFDPVsqgHXVkkD5Hp9QZoEY4caTGZfLRgXzyR4sYShXTCwFhdq0dWa2AqmBZFbiE1zRo6sBUg7ceSG42m6GcOBZk1m1YWskRL6UIJcBgFbGZo2F6HZaCKLUQO6iKCqA46cVQHRfcuyHg1g517NFq0UKg9uFQKUyzEsftVuQwUwwUYYFEYHSzIabmAYfBIGAIQgwfcYGBoYgANSvZ+Bs-nGLlNgAQighhfZkgEDN8B0IZtzwUh8GIAAtK9iG-Yh8EPNBpivaYhn6IYMDgI8hnKBhhBYKB-DAdo5Aqbh6hYQI2SHBh10-b9L23XdqXgrcUQQFFyi6EATWyTwQHeA5EFQTBcAIEhSC0McG1WUIvg6OR12IGB8AwDATyGBBXjQfophgGDygKUcCxzLEAEIpyfZhthfWUly+ajVy4ni+IEoT0GwPAiDISTjInWTylIhTjFPDigpgAABKQJXVAlouEYRNRwngnKKFzBOQdzRK8iSpJMlh-JqeTmggbjUv4g44iQCj8JYNJOAAEmoXKJwqOIvnaCpwzjeQExYbtexsxd+1aIA
💻 Code
Code is very, very simple, let's look on playground
🙁 Actual behavior
TS2551: Property content-runtime does not exist on type
🙂 Expected behavior
Not occur, because of part TS complaining about, not exists on
else
statement at all.The text was updated successfully, but these errors were encountered: