TypeScript error with React plugin on v7.3.0
See original GitHub issueHello,
I would like to report the new following TypeScript error following update to @bugsnag/js@7.3.0 and @bugsnag/plugin-react@7.3.0:
import React from 'react';
import Bugsnag from '@bugsnag/js';
import BugsnagPluginReact from '@bugsnag/plugin-react';
export const bugsnagClient = Bugsnag.createClient({
// ... rest of config omitted for simplicity
plugins: [new BugsnagPluginReact(React)],
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Property 'load' is missing in type 'BugsnagPluginReact' but required in type 'Plugin'.ts(2741)
});
Seems to be a regression in the types definition introduced in the internal refactors made for the 7.3.0 release.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Multiple Errors when using TypeScript + React - Stack Overflow
The errors are happening because the code is being transpiled with babel, then that transpiled code is being fed into AT loader.
Read more >eslint-config-react-app - npm
ESLint configuration used by Create React App. Latest version: 7.0.1, last published: 8 months ago. Start using eslint-config-react-app in ...
Read more >Introducing the New JSX Transform – React Blog
Manual Babel Setup Support for the new JSX transform is available in Babel v7. 9.0 and above. First, you'll need to update to...
Read more >Documentation - TypeScript 3.0
TypeScript 3.0 Release Notes. ... let v7: {} | null | undefined = x; // Error. } ... TypeScript 2.9 and earlier didn't...
Read more >Changelog - Cypress Documentation
Fixed an issue with Angular Component Testing where a custom sourceRoot configuration would not be respected. Fixes #24827. Fixed Typescript typings for cy....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @kamthamc, I’ve been investigating this and it’s a slightly different problem to the original issue. When using Yarn berry and Plug’n’Play,
@bugsnag/react-native
isn’t getting a copy of@bugsnag/core
which it needs to resolve the typesWe moved away from explicit dependencies on
@bugsnag/core
in our plugins because it causes a different Typescript issue when core is updated separately to a plugin (see https://github.com/bugsnag/bugsnag-js/issues/997)I’m still investigating what we can do to make bugsnag-js work out of the box with Yarn berry, but one of these workarounds should fix the error in the meantime:
pnpMode: loose
to .yarnrc.yml
@bugsnag/core
(i.e. runyarn add @bugsnag/core
)@mattdyoung I have created a repo https://github.com/kamthamc/demo-bugsnag-js
Note: I am using yarn
berry
If you want to use with vscode please run
yarn dlx @yarnpkg/pnpify --sdk vscode
you can simply run yarn start to see the error.