fix: CJS being imported instead of ESM when trying to load controllers from directory import #1346
Labels
status: needs triage
Issues which needs to be reproduced to be verified report.
type: fix
Issues describing a broken feature.
Description
I am currently trying to import controllers using the directory import syntax in an ESM project, but somehow somewhere the CJS files are being loaded which does not make sense, which in turn leads to an error being thrown in the controller saying "import statements can only be used in a module"
Code
TSConfig
express loader file
Controller file
The Error
An error gets thrown in the controller context
looking at the second to last line
it appears the CJS version is being loaded where module is not really defined
Expected behavior
ESM version is loaded and it works
Actual behavior
CJS version is loaded
The text was updated successfully, but these errors were encountered: