emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

TypeScript errors when `verbatimModuleSyntax` is enabled #20499

Closed boris-petrov closed 1 year ago

boris-petrov commented 1 year ago

🐞 Describe the Bug

Enabling verbatimModuleSyntax in tsconfig.json leads to a bunch of errors:

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:9:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

9     [InternalComponentCapability.DynamicLayout]: WithDynamicLayout;
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:10:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

10     [InternalComponentCapability.DynamicTag]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:11:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

11     [InternalComponentCapability.PrepareArgs]: WithPrepareArgs;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:12:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

12     [InternalComponentCapability.CreateArgs]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:13:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

13     [InternalComponentCapability.AttributeHook]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:14:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

14     [InternalComponentCapability.ElementHook]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:15:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

15     [InternalComponentCapability.DynamicScope]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:16:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

16     [InternalComponentCapability.CreateCaller]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:17:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

17     [InternalComponentCapability.UpdateHook]: WithUpdateHook;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:18:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

18     [InternalComponentCapability.CreateInstance]: WithCreateInstance;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:19:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

19     [InternalComponentCapability.Wrapped]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:20:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

20     [InternalComponentCapability.WillDestroy]: InternalComponentManager;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/manager/dist/types/lib/util/capabilities.d.ts:21:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

21     [InternalComponentCapability.HasSubOwner]: WithSubOwner;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/low-level.d.ts:5:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

5     [MachineRegister.pc]: number;
       ~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/low-level.d.ts:6:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

6     [MachineRegister.ra]: number;
       ~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/low-level.d.ts:7:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

7     [MachineRegister.sp]: number;
       ~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/low-level.d.ts:8:6 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

8     [MachineRegister.fp]: number;
       ~~~~~~~~~~~~~~~

node_modules/ember-source/node_modules/@glimmer/syntax/dist/types/lib/source/loc/offset.d.ts:118:21 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

118     readonly kind = OffsetKind.CharPosition;
                        ~~~~~~~~~~

node_modules/ember-source/node_modules/@glimmer/syntax/dist/types/lib/source/loc/offset.d.ts:153:21 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

153     readonly kind = OffsetKind.HbsPosition;
                        ~~~~~~~~~~

node_modules/ember-source/node_modules/@glimmer/syntax/dist/types/lib/source/loc/span.d.ts:176:21 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

176     readonly kind = OffsetKind.CharPosition;
                        ~~~~~~~~~~

node_modules/ember-source/node_modules/@glimmer/syntax/dist/types/lib/source/loc/span.d.ts:198:21 - error TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled.

198     readonly kind = OffsetKind.HbsPosition;
                        ~~~~~~~~~~

πŸ”¬ Minimal Reproduction

Repo.

Run npm install and then ./node_modules/.bin/tsc.

πŸ˜• Actual Behavior

Type errors in node_modules.

πŸ€” Expected Behavior

No errors.

🌍 Environment

cc @chriskrycho

boris-petrov commented 1 year ago

I believe this has been fixed in the newest version of Ember. Thanks!