I am trying to use the ES Module import with a path like ../module.js
and it gives me this error:
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
Here is the structure of the folders:
.
├── module.js
├── index.js
├── folder
│ └── test.js
Also here is the import and export statements
//folder/test.js
import { test } from "../module"
//module.js
export async function test(data) {
//Do Stuff then return data
}
Obviously, I have changed some file names and removed the function code. Please let me know if this is a problem.
Thank you!