snowflake-connector-nodejs
snowflake-connector-nodejs copied to clipboard
SNOW-1454180: `const enum`s in TypeScript declaration file means enums cannot be accessed when `isolatedModules` TS compiler option is set
Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!
1. What version of NodeJS driver are you using?
1.11.0
2. What operating system and processor architecture are you using?
macOS / ARM
3. What version of NodeJS are you using?
18.16.0 / 9.5.1
4. What are the component versions in the environment (npm list
)?
N/A
5.Server version:* E.g. 1.90.1
N/A (library author)
6. What did you do?
When using the newly-released first-party TypeScript declaration file, it's not possible to access the enums it provides, because they're declared as const enum
. It's not recommended to use const enum
s in library declarations for this reason.
You can see this issue in this TypeScript playground: https://www.typescriptlang.org/play/?isolatedModules=true#code/JYWwDg9gTgLgBAZwHYQO4DMA2BDA1gUwBo4BvOAGQgHNz8A3fTOAXznSghDgHJk0s8+ALQIAJrm4BuAFDSA9HLgAxbMEwI4qABb4kcYAgg4Y+UQFkIogK6Z8Gg4nzwYEODChX8+vTAQBjCCR0YCppPgwcAgA6AKCQqyh8AAoyTGpaBkwALgp0+kYogHUAQQAlADkWAEoZeUVizFRsAE8NVGhcBDCUCMEYwOCqBOTUvMyc7hKK7jhsDUoafKZmGqA
7. What did you expect to see?
No errors produced by this line, even if isolatedModules
is turned on in tsconfig.
snowflake.configure({ logLevel: LogLevel.WARN });
8. Can you set logging to DEBUG and collect the logs?
N/A
9. What is your Snowflake account identifier, if any? (Optional)
N/A