clio-lang / clio

Clio is a functional, parallel, distributed programming language.
https://clio-lang.org
Apache License 2.0
936 stars 30 forks source link

Error when running await example from tutorial #232

Closed Ivo-Balbaert closed 3 years ago

Ivo-Balbaert commented 3 years ago

Describe the bug I tried to run the 1st example:

import "js:node-fetch"

export fn main argv:
  "https://get.geojs.io/v1/ip/geo.json"
    -> await nodeFetch
    -> await .json
    -> console.log

I added node-fetch as instructed: clio deps add --npm node-fetch Added node-fetch@3.0.0 to the dependencies list in D:\Clio\own_projects\await\clio.toml

I got the error below:

To Reproduce

  1. in folder of await project: clio run

  2. See error:

D:\Clio\own_projects\await>clio run Info: Compiling from "D:\Clio\own_projects\await\clio.toml" Info: Creating build for target "js" √ Compiling source... √ Adding Clio start script... √ Installing npm dependencies (this may take a while)...

@ start D:\Clio\own_projects\await\build node .clio/index.js

(node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) (node:10112) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(Use node --trace-warnings ... to show where the warning was created) UnhandledPromiseRejectionWarning: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

(node:10112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js require() of ES modules is not supported. require() of D:\Clio\own_projects\await\build\node_modules\node-fetch\src\index.js from D:\Clio\own_projects\await\build\main.clio.js 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 D:\Clio\own_projects\await\build\node_modules\node-fetch\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.module.exports.exports (D:\Clio\own_projects\await\build\main.clio.js:1:117)
at run (D:\Clio\own_projects\await\build\node_modules\clio-run\src\index.js:103:33)
at Object.<anonymous> (D:\Clio\own_projects\await\build\node_modules\clio-run\src\workers\wt.js:14:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

(node:10112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. at emitDeprecationWarning (internal/process/promises.js:180:11) at processPromiseRejections (internal/process/promises.js:249:13) at processTicksAndRejections (internal/process/task_queues.js:94:32) Terminate batch job (Y/N)? y

D:\Clio\own_projects\await>

Instead of node::10112 I also see node:9416 or node:711, number seems to be random I have to do CTRL-C + Y to get back to the command-line.

Expected behavior Output of json file displayed

Versions

pouya-eghbali commented 3 years ago

I know what's happening here, if you install node-fetch v2.x the example works as expected, however in v3.x the node-fetch package is an ESM module. A lot of other packages are moving to ESM as well, an example that I had issues with is ora (we use it in Clio). There are two solutions to this:

  1. Compile Clio to ESM, this isn't really a huge change, we should just use import instead of require in the generated code
  2. Add an extra step to the compilation, using babel or parcel to fix the imports

I vote for the first solution.