You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: When I am running using this, I am getting this error
Worker for job "announcements" had an error {
err: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/me/Desktop/scrapper/src/scrappers/jobs/announcements.ts
require() of ES modules is not supported.
require() of /Users/me/Desktop/scrapper/src/scrappers/jobs/announcements.ts from /Users/me/Desktop/scrapper/node_modules/@breejs/ts-worker/src/worker.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /Users/me/Desktop/scrapper/package.json.
at createErrRequireEsm (/Users/me/Desktop/scrapper/node_modules/ts-node/dist-raw/node-internal-errors.js:46:15)
at assertScriptCanLoadAsCJSImpl (/Users/me/Desktop/scrapper/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js:584:11)
at Object.require.extensions.<computed> [as .ts] (/Users/me/Desktop/scrapper/node_modules/ts-node/src/index.ts:1610:5)
at Module.load (node:internal/modules/cjs/loader:1473:32)
at Function._load (node:internal/modules/cjs/loader:1285:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
at Module.require (node:internal/modules/cjs/loader:1495:12)
at require (node:internal/modules/helpers:135:16)
at Object.<anonymous> (/Users/me/Desktop/scrapper/node_modules/@breejs/ts-worker/src/worker.js:6:1) {
code: 'ERR_REQUIRE_ESM'
}
}
Worker for job "announcements" exited with code 1 undefined
Describe the bug
Node.js version: 23.6.0
OS version: macOS 14.6
Description: When I am running using this, I am getting this error
in my code I am using it as
NOTE:
I am using
tsx
to run myscrapper.ts
Checklist
The text was updated successfully, but these errors were encountered: