ApplicationInsights-JS: [BUG] `__extends` not found in
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 22
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?
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)
React v3.1.1 and ReactNative v2.3.1 are now published to NPM