Skip to content

Angular v17: Uncaught ReferenceError: process is not defined #121

@pras-bot

Description

@pras-bot

I am using 'twilio-taskrouter' v2.0.3 npm package in Angular v17 app.
Getting error on accessing the app from browser:

    at node_modules/util/util.js (util.js:109:1)
    at __require (chunk-ZTDPENTR.js?v=8eb4eef9:38:50)
    at 6464 (index.window.js:3:115268)
    at r2 (index.window.js:3:119424)
    at 5600 (index.window.js:3:108312)
    at r2 (index.window.js:3:119424)
    at 568 (index.window.js:3:95429)
    at r2 (index.window.js:3:119424)
    at 6427 (index.window.js:3:97502)
    at r2 (index.window.js:3:119424)

I have debugged this further, twilio-taskrouter is importing 'util' package, which tries to access the (Node) 'process' variable:

if (process.env.NODE_DEBUG) {
  var debugEnv = process.env.NODE_DEBUG;
  debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')
    .replace(/\*/g, '.*')
    .replace(/,/g, '$|^')
    .toUpperCase();
  debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions