Giter Site home page Giter Site logo

Comments (8)

joshuap avatar joshuap commented on June 1, 2024 1

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.

subzero10 avatar subzero10 commented on June 1, 2024

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.

JustFly1984 avatar JustFly1984 commented on June 1, 2024

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.

subzero10 avatar subzero10 commented on June 1, 2024

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.

JustFly1984 avatar JustFly1984 commented on June 1, 2024

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.

subzero10 avatar subzero10 commented on June 1, 2024

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.

subzero10 avatar subzero10 commented on June 1, 2024

Sounds good. I have created #332 to look into this further and take action.

from honeybadger-react.

subzero10 avatar subzero10 commented on June 1, 2024

This should be fixed with v2.1.0.

from honeybadger-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.