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
TypeScript Version: 3.0.0-dev.20180602
Search Terms:
Cannot find namespace, declaration, TS2503
Code
yarn add typescript@next yarn tsc -- src/foo.ts --declaration
const Foo = { BANANA: 'banana' as 'banana', } export const Baa = { [Foo.BANANA]: 1 };
Expected behavior:
No error.
Actual behavior:
src/foo.ts:6:4 - error TS2503: Cannot find namespace 'Foo'. 6 [Foo.BANANA]: 1 ~~~ error Command failed with exit code 2.
Omitting the --declaration option results in no error. Ommiting the cast results in no error.
--declaration
Playground Link:
Related Issues:
#24432
The text was updated successfully, but these errors were encountered:
Casting the key expression back to a string also resolves the issue:
export const Baa = { [Foo.BANANA as string]: 1 };
Sorry, something went wrong.
weswigham
No branches or pull requests
TypeScript Version: 3.0.0-dev.20180602
Search Terms:
Cannot find namespace, declaration, TS2503
Code
Expected behavior:
No error.
Actual behavior:
Omitting the
--declaration
option results in no error.Ommiting the cast results in no error.
Playground Link:
Related Issues:
#24432
The text was updated successfully, but these errors were encountered: