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.

Remove `react` as peer dependency

See original GitHub issue

Describe the bug

As described in the readme:

Tech stacks: The library ships as a set of web components. This means developers can use the toolkit no matter which tech stack – React, Vue, Svelte, etc. – their extension is built with.

However react is explicitly defined as peer dependency which causes warnings during install.

To reproduce

Run yarn add @vscode/extension-telemetry

❯ yarn add @vscode/extension-telemetry
yarn add v1.22.18
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > @vscode/webview-ui-toolkit@1.0.0" has unmet peer dependency "react@>=16.9.0".
warning "@vscode/webview-ui-toolkit > @microsoft/fast-react-wrapper@0.1.48" has unmet peer dependency "react@>=16.9.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 5 new dependencies.
info Direct dependencies
└─ @vscode/extension-telemetry@0.6.2
info All dependencies
├─ @microsoft/1ds-core-js@3.2.4
├─ @microsoft/1ds-post-js@3.2.4
├─ @microsoft/applicationinsights-core-js@2.8.5
├─ @microsoft/applicationinsights-shims@2.0.1
└─ @vscode/extension-telemetry@0.6.2
✨  Done in 6.58s.

Expected behavior

There is no peer dependency defined. Even though it is only a warning and it works nonetheless, I suggest to remove it as it suggests something wrong.

Current behavior

Peer dependency is defined and causes warnings during install.

Screenshots

Desktop (please complete the following information):

  • OS Version: [e.g. macOS 11.3.1]
  • Toolkit Version: [e.g. v0.8.0]

Additional context

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hawkticehurstcommented, Dec 7, 2022

Unfortunately, I don’t have any notable updates. I did some explorations on the “alternative” I was hopeful about and it proved to be not super fruitful for our particular scenario/architecture

Since that time we have become really tightly resourced (myself and one other person split our time between this project and a handful of others) so we probably won’t be able to tackle it for a while since it’s a non-blocking issue

As I find pockets of time, however, I’ll definitely try to revisit this and give updates on anything I discover

1reaction
svewcommented, Oct 19, 2022

Any updates on this? Not blocking, but annoying 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

remove React as peer dependency #6532 - GitHub
Related to this, I'm having trouble using useReactiveVar in Apollo Angular, as it gives missing React peer dependency warnings when imported ...
Read more >
How to remove optional peer dependency from NPM project?
I thought the idea of peer dependencies is to allow for the root project to select the version in use. Also, it is...
Read more >
Uninstalling packages and dependencies - npm Docs
To remove a package from your node_modules directory, on the command line, use the uninstall command. Include the scope if the package is...
Read more >
yarn remove
When you remove a package, it is removed from all types of dependencies: dependencies , devDependencies , etc. Note: yarn remove will always...
Read more >
Difference between dependencies, devDependencies and ...
peerDependencies are not automatically installed. You need to manually modify your package.json file in order to add a Peer Dependency. These ...
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