Closed
Description
Bug Report
🔎 Search Terms
- rxjs
- re-export
- declaration
- composite
- project references
🕗 Version & Regression Information
- This changed between versions 4.4.4 and 4.5.1-rc
⏯ Playground Link
N/A
💻 Code
package.json
:
{
"dependencies": {
"rxjs": "^7.4.0",
"typescript": "^4.5.1-rc"
}
}
tsconfig.json
:
{
"compilerOptions": {
"target": "ESNext",
"module": "CommonJS",
"declaration": true,
"outDir": "./target/"
},
"files": ["./src/main.ts"],
}
src/facade.ts
:
export { connectable, EMPTY } from 'rxjs';
src/main.ts
:
import * as Rx from './facade';
export const myConnectable = Rx.connectable(Rx.EMPTY);
Steps to reproduce:
- Run
yarn
- Run
tsc
🙁 Actual behavior
No error, as it behaved in 4.4.4.
🙂 Expected behavior
Error:
$ tsc
src/main.ts:3:14 - error TS2742: The inferred type of 'myConnectable' cannot be named without a reference to '../node_modules/rxjs/dist/types'. This is likely not portable. A type annotation is necessary.
3 export const myConnectable = Rx.connectable(Rx.EMPTY);
~~~~~~~~~~~~~
Found 1 error.
I am able to workaround this by modifying src/facade.ts
like so:
export { connectable, EMPTY } from 'rxjs';
+export * from 'rxjs/internal/types'
Note also that the error doesn't reproduce if we import directly from rxjs
:
src/main.ts
:
import { EMPTY, connectable } from 'rxjs';
export const myConnectable = connectable(EMPTY);