I created a small TS app recently.
Inside the project, there is a file named en.js
with the following content:
export default {
name: "test"
}
However, when I attempt to import it, the import does not work as expected:
await import("./en.js")
An error message appears saying code: 'MODULE_NOT_FOUND'
Surprisingly, if I convert the file into a .json
, the import works smoothly:
//en.json
{
"name": "test"
}
After making this change, the import functions properly:
await import("./en.json");