Closed mpanichellaperez closed 1 year ago
This is an issue with your bundler. You might want to try using "node:child_process" and/or look into issues with the bundler.
But I used typescript, and the import is direct with typescript as a function. I don't think that the problem is with the bundler.
Describe the bug
Node.js version: 16.10.0
OS version: Windows 11
Description: When I tried to use some dependency, I have a "is not defined" error
err: [worker eval]:3 (0, child_process_1.execSync)(opensslDomain, { cwd: "." }).toString(); ^
ReferenceError: child_process_1 is not defined at processCertificates ([worker eval]:3:5) at [worker eval]:19:3 at Script.runInThisContext (node:vm:129:12) at Object.runInThisContext (node:vm:305:38) at node:internal/process/execution:81:19 at [worker eval]-wrapper:6:22 at evalScript (node:internal/process/execution:80:60) at MessagePort. (node:internal/main/worker_thread:176:7)
at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:559:20)
at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
}
Code to reproduce
Into the job import a dependency, for example in my case is
import { execSync } from "child_process"; import fs from "fs";