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

Latest @sentry/browser asks for node types #2927

Closed
4 of 9 tasks
MhMadHamster opened this issue Sep 22, 2020 · 3 comments · Fixed by #3050
Closed
4 of 9 tasks

Latest @sentry/browser asks for node types #2927

MhMadHamster opened this issue Sep 22, 2020 · 3 comments · Fixed by #3050

Comments

@MhMadHamster
Copy link

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.24.2

Description

Latest version of @sentry/browser via dependencies pulls @sentry/hub which requires node types, essentially making @sentry/browser dependent on node types, and that makes little sense to me since i'm using it in browser. For me the culprit is node_modules\@sentry\hub\dist\interfaces.d.ts asking for "domain" module from node types.

@MhMadHamster MhMadHamster changed the title Latest @sentry/browser asks fore node types Latest @sentry/browser asks for node types Sep 30, 2020
@sylvain101010
Copy link

sylvain101010 commented Oct 1, 2020

Not sure if related, but installing @sentry/browser and @sentry/integrations breaks my VueJS build:

ERROR in /webapp/node_modules/@types/node/ts3.1/globals.d.ts(573,15):
573:15 Interface 'NodeJS.Module' incorrectly extends interface '__WebpackModuleApi.Module'.
  Types of property 'parent' are incompatible.
    Type 'Module | null | undefined' is not assignable to type 'NodeModule | null'.
      Type 'undefined' is not assignable to type 'NodeModule | null'.
    571 |         '.node': (m: Module, filename: string) => any;
    572 |     }
  > 573 |     interface Module {
        |               ^
    574 |         exports: any;
    575 |         require: Require;
    576 |         id: string;

@dleavitt
Copy link

dleavitt commented Oct 8, 2020

Yep, caused by this commit:
7c14283#diff-7845e1ba449e4a817931bf2ee2bd1c9d

Importing "domain" (part of the node stdlib) puts all of node into the ambient context and breaks everyone's browser projects.

This is a very persistent issue with libs that support both node and the browser:

@aleclarson
Copy link
Contributor

See #3050 for a fix.

HazAT added a commit that referenced this issue Nov 13, 2020
* fix: stop using @types/node in @sentry/hub

Fixes #2927

* fix: Linter

Co-authored-by: Daniel Griesser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants