Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run RNW CLI commands due to TypeError: _this._shutdownStatsbeat is not a function #12587

Closed
jonthysell opened this issue Jan 10, 2024 · 3 comments
Labels

Comments

@jonthysell
Copy link
Contributor

jonthysell commented Jan 10, 2024

Problem Description

A bug was introduced in the [email protected] package which breaks our CLI commands.

That bug upstream: microsoft/ApplicationInsights-node.js#1258
The PR to fix it upstream: microsoft/ApplicationInsights-node.js#1259

It's possible to hit this bug in any of several versions of RNW, especially with new projects as they may pull this newer, broken version of applicationinsights, unless you're using a lock file to prevent it.

Example error:

E:\repos\react-native-windows3\node_modules\applicationinsights\Library\Sender.ts:203
                            this._shutdownStatsbeat();
                                 ^
TypeError: _this._shutdownStatsbeat is not a function
    at IncomingMessage.<anonymous> (E:\repos\react-native-windows3\node_modules\applicationinsights\Library\Sender.ts:203:34)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
[4:15:19 PM] x Error detected while running 'codegen'
[4:15:19 PM] x ------------------------------------
[4:15:19 PM] x Error: Command failed: npx react-native codegen-windows --logging

Steps To Reproduce

Try to run a CLI command (or yarn build our repo, which will call the codegen-windows command internally).

Expected Results

Command works

CLI version

12.0.0

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22631
  CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  Memory: 6.28 GB / 15.84 GB
Binaries:
  Node:
    version: 18.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.8.34408.163 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Target Platform Version

None

Target Device(s)

Desktop

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

@jonthysell jonthysell added the bug label Jan 10, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jan 10, 2024
@jonthysell
Copy link
Contributor Author

The fix for now is to lock to an older version of applicationinsights, as we've done:

@janek
Copy link

janek commented Jan 10, 2024

Thank you for fixing this so quickly! I ran into this earlier today and was just coming back to open an issue.

@jonthysell
Copy link
Contributor Author

This fix has now been released in RNW 0.72.24 and RNW 0.73.4.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants