question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] `__extends` not found in

See original GitHub issue

Description/Screenshot

Having issues with the esm distribution since yesterday, get the following error stack on load of a production create-react-app build:

ApplicationInsights.js:540 Uncaught ReferenceError: __extends is not defined
    at ApplicationInsights.js:540
    at Object.<anonymous> (ApplicationInsights.js:17)
    at l ((index):1)
    at Object.317 (main.37854ca8.chunk.js:formatted:23035)
    at l ((index):1)
    at Object.23 (main.37854ca8.chunk.js:formatted:22248)
    at l ((index):1)
    at Object.66 (main.37854ca8.chunk.js:formatted:24794)
    at l ((index):1)
    at Object.50 (main.37854ca8.chunk.js:formatted:24026)

__extends not found in production create-react-app with the following imports

import { ApplicationInsights, ITelemetryPlugin } from "@microsoft/applicationinsights-web";
import { ReactPlugin } from "@microsoft/applicationinsights-react-js";

Tried downgrading by pinning @microsoft/applicationinsights-react-js to 2.5.4 and tslib to 1.11.2, didn’t help. Also haven’t been able to reproduce in the local webpack development server, tested 2.5.4, 3.0.0, and tslib 1.3, 1.11.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:22 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
sommeshcommented, Apr 26, 2021

Current version: “@microsoft/applicationinsights-react-js”: “^3.1.0”, “@microsoft/applicationinsights-shims”: “^2.0.0”, “@microsoft/applicationinsights-web”: “^2.6.2”,

And added the import in base index import '@microsoft/applicationinsights-shims';

But still, getting the error: ReactPlugin.js:7 Uncaught ReferenceError: __extends is not defined at ReactPlugin.js:7 at Module…/node_modules/@microsoft/applicationinsights-react-js/dist-esm/ReactPlugin.js (ReactPlugin.js:87)

Any workaround or fix?

2reactions
MSNevcommented, Apr 26, 2021

PR for bumping versions to consume v2.6.2 and shims v2.0.0 is out #1552 This is required as the components that the released react plugin is using internally still references the 1.0.3 shims, which assumes the global presence of the __extends() and __assign() tslib helpers. While v2.6.2 now replaces (during packaging) the breaking 1.13.0 tslib components (which caused us to create these in the first place)

Read more comments on GitHub >

github_iconTop Results From Across the Web

fatal error - Class not found (in PHP) - Stack Overflow
"when the extending class is declared, the parent class doesn't exist yet, which will cause the extending class to not exist, too." From...
Read more >
Extending a class, but a fatal error, the parent is not found
I'm extending GenericObject.phpm to another class, payees.phpm, but I am getting a fatal error, "Class 'GenericObject' not found.
Read more >
extends - JavaScript - MDN Web Docs - Mozilla
The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
Read more >
Object Inheritance - Manual - PHP
For example, when extending a class, the subclass inherits all of the public and ... Private methods of a parent class are not...
Read more >
Extend a class without namespace - Laracasts
i got: Fatal error: Uncaught Error: Class 'MyPlugin\Actions\NF_Abstracts_Action' not found in. When I do. Copy Code final class MultiMailjet extends \ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found