node-rs icon indicating copy to clipboard operation
node-rs copied to clipboard

Consider using not-const enums to be compatible with `isolatedModules`

Open davidyuk opened this issue 1 year ago • 0 comments

import { Algorithm } from '@node-rs/argon2';
console.log(Algorithm.Argon2d);

when I'm running tsc, it fails with

src/index.ts:2:13 - error TS2748: Cannot access ambient const enums when 'isolatedModules' is enabled.

I have isolatedModules switched on because I'm using Babel to compile my project.

To fix this problem would be best to export usual enums instead of const enum. Related articles:

  • https://stackoverflow.com/a/62175702/6176994
  • https://ncjamieson.com/dont-export-const-enums/

davidyuk avatar Mar 20 '24 05:03 davidyuk