I have encountered an issue with my TypeScript class:
export class Vehicule extends TrackableEntity {
vehiculeId: number;
constructor() {
super();
return super.proxify(this);
}
}
The target for my TypeScript in tsconfig.json is set to es6:
"compilerOptions": {
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
}
When running the code in Chrome, I am encountering this error:
ReferenceError: Cannot access 'Vehicule' before initialization
at Module.Vehicule (https://localhost:44338/src-app-components-dispositifsDATI-dispositifsDATI-module.js:10559:100)
...
I had to switch from es5 to es6 to address another issue.
UPDATE: The VehiculeGpsBoxInfo.ts file imports Vehicule like this:
import { Vehicule } from "./Vehicule";
Further investigation suggests that this could be related to webpack and how modules are exported and imported.
LATEST UPDATE: Upon more research, it appears that the issue is not directly related to the code provided above. I have initiated a new inquiry regarding webpack and ES6.