Skip to content
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

@types/ - TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided. #28744

Closed
4 tasks done
wallzero opened this issue Sep 9, 2018 · 3 comments

Comments

@wallzero
Copy link
Contributor

wallzero commented Sep 9, 2018

If you know how to fix the issue, make a pull request instead.

  • I tried using the @types/xxxx package and had problems.
  • I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • Mention the authors (see Definitions by: in index.d.ts) so they can respond.

I updated my builds to use Babel7 after following the official blog post.

However, @types/range-parser (which appears to a dependency of express) throws an error during compilation: TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.

I can disable isolatedModules and my project builds but the guide says it is needed to disallow features that require cross-file information for emit.

@bopfer
Copy link

bopfer commented Oct 12, 2018

Any movement on this? I am running into the same issue. According to the comments here: microsoft/TypeScript#20703 (comment), it should be changed to a union type of literals instead.

Removing const from the enum also seems to work, but I am not sure if that is a proper fix.

@wyqydsyq
Copy link

wyqydsyq commented Dec 7, 2018

This issue has been resolved in #29783 but a naughty bot closed the PR as a result of Travis CI failing, seemingly due to errors from completely unrelated packages. Looks like a maintainer/contributor with adequate permissions will need to manually re-open the PR to make travis test it again.

@orta
Copy link
Collaborator

orta commented Jun 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants