Strict-mode does not allow assignment to undefined variables

1.4k Views Asked by At

After build the TypeScript using tsdx and doing the minify with NUglify I start to get the error Strict-mode does not allow assignment to undefined variables: regeneratorRuntime.

try {
  regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
  // This module should not be running in strict mode, so the above
  // assignment should always work unless something is misconfigured. Just
  // in case runtime.js accidentally runs in strict mode, we can escape
  // strict mode using a global Function call. This could conceivably fail
  // if a Content Security Policy forbids using Function, but in that case
  // the proper solution is to fix the accidental strict mode problem. If
  // you've misconfigured your bundler to force strict mode and applied a
  // CSP to forbid Function, and you're not willing to fix either of those
  // problems, please detail your unique predicament in a GitHub issue.
  Function("r", "regeneratorRuntime = r")(runtime);
}
});

How can I fix this error not having to just ignore it?

0

There are 0 best solutions below