You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A project targeting ES3 that transitively depends on @types/acorn will error on compile #24595
Expected behavior: foo.ts compiles with no problem.
Observed behavior:
node_modules/@types/acorn/index.d.ts(240,8): error TS2304: Cannot find name 'Symbol'.
node_modules/@types/acorn/index.d.ts(240,28): error TS2304: Cannot find name 'Iterator'.
I tried to fix this, but the only thing that seems to make the error go away is:
declare global {interfaceSymbolConstructor{readonlyiterator: symbol;}varSymbol: SymbolConstructor;}
Which leaks Symbol and Symbol.iterator into the global scope for foo.ts, when it shouldn't be available since foo.ts is being compiled to target ES3.
I also tried looking into what other type packages do to fix this, but I only found other type packages that have a similar problem, for example @types/zen-observables:
node_modules/@types/zen-observable/index.d.ts(35,14): error TS2304: Cannot find name 'Symbol'.
node_modules/@types/zen-observable/index.d.ts(46,6): error TS2304: Cannot find name 'Symbol'.
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.
To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.
Activity
Move @types/acorn dependencies => devDependencies
orta commentedon Jun 7, 2021
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the
@typesmodules in DefinitelyTyped.To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the
definitely-typedchannel.