aurelia / dependency-injection

A lightweight, extensible dependency injection container for JavaScript.
MIT License
160 stars 66 forks source link

Building project in babel-loader fails on const enum because of --isolatedModules flag #188

Closed groenlid closed 4 years ago

groenlid commented 4 years ago

I'm submitting a feature request

Please tell us about your environment:

Current behavior: When we try to build our aurelia app written in typescript through babel-loader, we are getting an error on this package which says:

node_modules/aurelia-dependency-injection/dist/aurelia-dependency-injection.d.ts:61:3 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

61  [Strategy.instance]: TImpl;
     ~~~~~~~~

node_modules/aurelia-dependency-injection/dist/aurelia-dependency-injection.d.ts:62:3 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

62  [Strategy.singleton]: DependencyCtorOrFunctor<TBase, TImpl, TArgs>;
     ~~~~~~~~

node_modules/aurelia-dependency-injection/dist/aurelia-dependency-injection.d.ts:63:3 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

63  [Strategy.transient]: DependencyCtorOrFunctor<TBase, TImpl, TArgs>;
     ~~~~~~~~

node_modules/aurelia-dependency-injection/dist/aurelia-dependency-injection.d.ts:64:3 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

64  [Strategy.function]: StrategyFunctor<TBase, TImpl, TArgs>;
     ~~~~~~~~

node_modules/aurelia-dependency-injection/dist/aurelia-dependency-injection.d.ts:65:3 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

65  [Strategy.array]: [{
     ~~~~~~~~

node_modules/aurelia-dependency-injection/dist/aurelia-dependency-injection.d.ts:68:3 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

68  [Strategy.alias]: any;
     ~~~~~~~~

Expected/desired behavior:

EisenbergEffect commented 4 years ago

@DrSammyD This may be another side-effect of the TS conversion. When you submit the other PR, can you just remove the const from this enum for now?