Skip to content

ReferenceError: require is not defined #1161

@pensono

Description

@pensono

I often get an error message like this one.
ReferenceError: require is not defined

Why does it happen? What should I do to work around it?

[Workflow] Error while running workflow {
  workflowRunId: 'wrun_01KJ34497C1A7Z97YD8KS2T8VY',
  errorName: 'ReferenceError',
  errorStack: './workflows/backfill:22445\n' +
    'var import_os = __toESM(require("os"), 1);\n' +
    '                ^\n' +
    '\n' +
    'ReferenceError: require is not defined\n' +
    '    at anonymous (node_modules/.pnpm/postgres@3.4.8/node_modules/postgres/src/index.js:1:15)\n' +
    '    at Script.runInContext (node:vm:149:12)\n' +
    '    at runInContext (node:vm:301:6)\n' +
    '    at F:\\Data\\Code\\Website\\my-project\\.next\\dev\\server\\chunks\\04ddb_@workflow_core_dist_4d58fc8f._.js:4041:158\n' +
workflow: 4.1.0-beta.57,
turbo: 2.5.8,
next: 16.1.1,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions