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' does not exist on type 'SymbolConstructor' #108

Closed
PopGoesTheWza opened this issue Mar 10, 2020 · 1 comment · Fixed by #120
Closed

Property 'observable' does not exist on type 'SymbolConstructor' #108

PopGoesTheWza opened this issue Mar 10, 2020 · 1 comment · Fixed by #120

Comments

@PopGoesTheWza
Copy link
Contributor

Since I found a solution to my problem, this issue is rather informational.

On a small mono-repo (lerna@3.20.2) project:

  • node.js v12.16.1 and npm 6.14.2
  • typescript@^3.8.3 as root devDependencies
  • @types/node@^12.12.29 as root devDependencies
  • @sindre/sorhus@^2.1.0 as package dependencies
❯ tsc --build tsconfig.json
node_modules/@sindresorhus/is/dist/index.d.ts:135:13 - error TS2339: Property 'observable' does not exist on type 'SymbolConstructor'.

135     [Symbol.observable](): ObservableLike;
                ~~~~~~~~~~

From what I could gather, observable on type SymbolConstructor is defined in @types/node@12.12.29 (which is installed in the root node_modules), but not in @types/node@13.7.7 (which ends up being installed in the package's node_module as a side effect.)

One kludgy quick-fix could be to add @types/node@^12.12.29 in the package's devDependencies

Another, arguably cleaner solution is to use lerna bootstrap --hoist so that root node_modules prevails.

EricCrosson added a commit to strong-roots-capital/map-objects that referenced this issue Mar 11, 2020
Necessary for compilation.

Read more: sindresorhus/is#108
@Richienb
Copy link
Contributor

type-fest fixed this exact issue in sindresorhus/type-fest#21. Therefore, we just need to fix #85.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants