Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
Why property does not exist on type in rxjs pipe function?

Why I losing the type in my pipe function? How to fix that?

Property 'n' does not exist on type '{}'

stackblitz

import { of, map, Observable, Subject, pipe, tap } from 'rxjs';
import { exhaustMap, withLatestFrom } from 'rxjs/operators';

const action = new Subject<{ n: number }>();
const id$ = of(1);

const bar = () =>
  pipe(
    withLatestFrom(id$),
    exhaustMap(([{ n }, id]) => of([n, id])), // <--- Property 'n' does not exist on type '{}'
    tap(() => {
      console.log('in bar pipeline');
    })
  );

const foo = action.pipe(bar());

foo.subscribe();

action.next({ n: 1 });
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

pipe infers all types from passed parameters. Take a look on https://github.com/ReactiveX/rxjs/blob/master/src/internal/util/pipe.ts

Try to specify type for first parameter for auto-inferring for all.

withLatestFrom<{ n: number }, number[]>(id$),
about 4 years ago · Juan Pablo Isaza Denunciar

0

Add the proper data type:

const bar = () =>
  pipe(
    withLatestFrom(id$),
    exhaustMap(([{ n }, id]: [ {n: number}, number ]) => of([n, id]))
    tap(() => {
      console.log('in bar pipeline');
    })
  );
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda