I'm currently upgrading from webpack 3 to 5 using ruby on rails shakapacker
gem which is the successor of webpacker (a wrapper around webpack)
I'm bumping into the issue that some of the enums
I defined in my types.ts
files are undefined when loading inside the browser.
Example:
Constants.ts
// Some source file
export const DEFAULT_LOCALE: Locale = Locale.EN;
types.ts
const enum Locale {
EN = 'en',
NL = 'nl',
FR = 'fr',
DE = 'de'
}
I see no typescript errors whatsoever. Loading the page results in this error being thrown.
It seems the enums are stripped for some reason, but I don't know what new configuration might have changed this.
This code works as expected on a previous version
Any help in the right direction would be greatly appreciated!
Kind regards Jens