Comments (8)
I'm installing both, cos else eslint warns about missing dependency. It is better to set
@honeybadger-io/js
as peer dependency in@honeybadger-io/react
Hmm, I see. It may be a good idea to have the core package as peer dependency. @joshuap What do you think? I can see that others are doing it also (react). It will be a breaking change though, so we'll have to release a major version update.
For now, I have fixed the conflicts and react@18 warning with this PR and this PR. Last one should be merged soon and we'll release a new version right after.
I'm OK with doing a major release if this is the right way to do it, and it will make the developer experience smoother long-term.
from honeybadger-react.
Hey @JustFly1984, thanks for submitting an issue!
Are you saying that you have both Honeybadger packages in your dependencies array?
Like:
"dependencies": {
"@honeybadger-io/js": "^4.0.2"
"@honeybadger-io/react": "^3.2.9"
...
}
If yes, you shouldn't need to do that. @honeybadger-io/js
is a dependency of @honeybadger-io/react
and it should always install the correct version.
FYI, I'm working on bringing the latest version of @honeybadger-io/js
to @honeybadger-io/react
.
from honeybadger-react.
We have nextjs app, with graphql @apollo/client which has both server and frontend part.
The only import we are using from /react
is import { HoneybadgerErrorBoundary } from '@honeybadger-io/react';
import { HoneybadgerErrorBoundary } from '@honeybadger-io/react';
import { withApollo } from '../lib/apollo';
import honeybadger from '../lib/honeybadger';
import type { AppProps } from 'next/app';
import type { NextPage } from 'next';
const App: NextPage<AppProps, AppProps> = function App({
Component,
pageProps,
}: AppProps): JSX.Element {
return (
<HoneybadgerErrorBoundary honeybadger={honeybadger}>
<Component {...pageProps} />
</HoneybadgerErrorBoundary>
);
};
export default withApollo()(App);
All other imports in our app is dode from /js
import type { Noticeable } from '@honeybadger-io/js/dist/browser/types/core/types';
in /lib/honeybadger.ts
:
/* Using alpha version of universal HB because hb server doesn't work since next 9.6+ */
import Honeybadger from '@honeybadger-io/js';
import type Client from '@honeybadger-io/js/dist/server/types/core/client.js';
const config: Partial<Client['config']> = {
apiKey: process.env['HONEYBADGER_API_KEY'] || '',
environment: process.env['HONEYBADGER_ENV'] || '',
revision: process.env['HONEYBADGER_REVISION'] || '',
// onerror: false,
// Docs outdated https://github.com/honeybadger-io/honeybadger-js/blob/master/src/browser.ts#L133
enableUncaught: false,
};
const honeybadger = Honeybadger.configure(config);
export default honeybadger;
Should I adjust honeybadger setup in some way?
from honeybadger-react.
No, I think this is good. Can you please post your dependencies in your package.json file?
I'd like to know if you are installing both @honeybadger-io/js
and @honeybadger-io/react
or just @honeybadger-io/react
.
Thanks!
from honeybadger-react.
I'm installing both, cos else eslint warns about missing dependency.
It is better to set @honeybadger-io/js
as peer dependency in @honeybadger-io/react
from honeybadger-react.
I'm installing both, cos else eslint warns about missing dependency. It is better to set
@honeybadger-io/js
as peer dependency in@honeybadger-io/react
Hmm, I see. It may be a good idea to have the core package as peer dependency.
@joshuap What do you think? I can see that others are doing it also (react). It will be a breaking change though, so we'll have to release a major version update.
For now, I have fixed the conflicts and react@18 warning with this PR and this PR. Last one should be merged soon and we'll release a new version right after.
from honeybadger-react.
Sounds good. I have created #332 to look into this further and take action.
from honeybadger-react.
This should be fixed with v2.1.0.
from honeybadger-react.
Related Issues (20)
- Setup config and add context HOT 2
- Beta version honeybadger-js HOT 1
- Double notification HOT 3
- Fix documentation site HOT 3
- Bump peerDependencies version HOT 1
- Transform to Typescript HOT 4
- @honeybadger-io/react does not contain a default export as described in the docs HOT 2
- Custom context values in error object discarded by react error handler
- Missing sourcemaps or a misconfigured package with Create React App - CRA HOT 9
- Enforce Conventional Commits HOT 1
- Shipjs Integration
- Shipjs Integration
- react@18 support HOT 2
- Make `@honeybadger-io/js` a peer dependency HOT 2
- Integrating our projects? HOT 4
- ErrorComponent prop on HoneyBadgerErrorBoundary wasn't mentioned anywhere in docs
- New release? HOT 5
- Upgrade to Babel 7
- TypeScript types are not included in npm package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from honeybadger-react.