-
-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
I'm hitting a similar issue to TypeStrong/ts-node#155 (comment) with ava and ts-node while importing this in one of the functions I'm testing.
If there's no fix feel free to close this. I figured I couldn't hurt to open and at least others will now be able to find this.
Uncaught exception in test/app/graphql/resolvers/query/display.ts
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/xo/code/unraid/api/node_modules/path-type/index.js
require() of ES modules is not supported.
require() of /Users/xo/code/unraid/api/node_modules/path-type/index.js from /Users/xo/code/unraid/api/app/core/modules/info/get-all-devices.ts is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/xo/code/unraid/api/node_modules/path-type/package.json.
› Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from node_modules/path-type/package.json.
› Object.<anonymous> (app/core/modules/info/get-all-devices.ts:4:4)
alexfanshawebabylon and ewnd9OnkelTem
Metadata
Metadata
Assignees
Labels
No labels