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

Property 'observable' must be of type 'symbol', but here has type 'unique symbol'. #7337

Closed
matt-goldman opened this issue Nov 17, 2020 · 6 comments

Comments

@matt-goldman
Copy link

Intended outcome:

Install the apollo angular client

Actual outcome:

Client installs, but project will not compile. With a brand new Angular 11 project, with nothing done to it except ng add apollo-angular, I get the following error

ERROR in node_modules/@apollo/client/node_modules/symbol-observable/index.d.ts:6:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'observable' must be of type 'symbol', but here has type 'unique symbol'.

    6     readonly observable: unique symbol;
                   ~~~~~~~~~~

      node_modules/@types/node/globals.d.ts:146:14
        146     readonly observable: symbol;
                         ~~~~~~~~~~
        'observable' was also declared here.

How to reproduce the issue:

  1. Create a new Angular project
  2. Install Apollo client with ng add apollo-angular
  3. Try to build or run the project

Versions

System:
OS: Windows 10 10.0.18363
Binaries:
Node: 12.16.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 86.0.4240.198
Edge: Spartan (44.18362.449.0)
npmPackages:
@apollo/client: ^3.0.0 => 3.2.6
apollo-angular: ^2.1.0 => 2.1.0

@matt-goldman
Copy link
Author

Looks like this is the issue caused by #7335

benjamn added a commit that referenced this issue Nov 17, 2020
@benjamn benjamn self-assigned this Nov 17, 2020
benjamn added a commit that referenced this issue Nov 17, 2020
…" (#7340)

This reverts commit 2809d6d,
fixing issue #7337. The problem is not the `@types/node` version, as
conjectured in #7335, but the incompatibility between the version of
`@types/node` used by Angular and our recent major update of
`symbol-observable`, which is a non-dev dependency of `@apollo/client`.
@gaetancollaud
Copy link

gaetancollaud commented Nov 17, 2020

Hi,

My solution was to set the symbol-observable version to 2.x.y instead of 3.x.y.

  "devDependencies": {
    "symbol-observable": "^2.0.3",

@fetis
Copy link

fetis commented Nov 17, 2020

as workaround, you can install version 3.2.5 of the client with npm install @apollo/client@3.2.5

this fixed things on my side.

@benjamn
Copy link
Member

benjamn commented Nov 17, 2020

This should now be fixed in @apollo/client@3.2.7, thanks to #7340, as verified by successfully running ng add angular-apollo in a new Angular application, following @matt-goldman's reproduction steps.

@benjamn benjamn closed this as completed Nov 17, 2020
@fetis
Copy link

fetis commented Nov 17, 2020

@benjamn yes, it's fixed now. thank you-thank you-thank you

1 similar comment
@fetis
Copy link

fetis commented Nov 17, 2020

@benjamn yes, it's fixed now. thank you-thank you-thank you

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants