node-rs
node-rs copied to clipboard
Consider using not-const enums to be compatible with `isolatedModules`
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/