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
name is special #8132
Comments
The issue is that there's always a https://developer.mozilla.org/en-US/docs/Web/API/Window/name In TypeScript 2.0, you'll be able to exclude the definition using the |
See also #8107. |
Then maybe the TypeScript documentation should be changed? |
I already have fixed this at microsoft/TypeScript-Handbook#251, so we'll just need to republish the docs to the website. |
@DanielRosenwasser is there anyway to get more context on where this "name" variable is defined ? I'm only getting |
you should see another error for the other file, something like: ./node_modules/typescript/lib/lib.d.ts(18454,15): error TS2451: Cannot redeclare block-scoped variable 'name'.
./test/a.ts(1,5): error TS2451: Cannot redeclare block-scoped variable 'name'. |
no I'm not, that's the problem :( |
how are your running your compiler? what version of tsc are you using? can you share a repro? |
I'm using webpack 1.x with awesome-typescript-loader and typescript 2.0.2 |
so if you run tsc on the tsconfig directly not through awesome-typescript-loader, do you see the error? |
I retried with just tsc, no error, it builds the project just fine, I guess the problem lies within awesome-typescript-loader then :) |
what version of tsc were you using? this change was introduced in TS 2.0. |
I was using 2.0.0 before, and updated to 2.0.2, I updated awesome-typescript-loader from 2.2.1 to 2.2.4 at the same time |
that is not what i would expect. i would expect an error message for re-declaring a block-scoped variable. i would be interested to see a repro project if one is available. |
Ok, as it turns out the problem was with zone.js that was polluting the global namespace and replacing window.name (angular/zone.js#456), I just updated zone.js and the error disappeared ! |
TypeScript Version:
Version 1.9.0-dev.20160417
Code
Expected behavior:
compile
Actual behavior:
error TS2451: Cannot redeclare block-scoped variable 'name'.
The text was updated successfully, but these errors were encountered: