Closed
Description
Bug Report
Hello team,
Not sure if it's a limitation or a bug, but when using types across workspaces, some of them are not following along.
I can not explain why, but I have a small repro
🔎 Search Terms
types, express, workspaces, references,
🕗 Version & Regression Information
- This changed between versions 4.2.4 -> 4.3.2
- Still happening with @next
⏯ Playground Link
- A working example without workspaces: https://www.typescriptlang.org/play?ssl=21&ssc=3&pln=13&pc=1#code/JYWwDg9gTgLgBAUwB5iggzuuAzKERwDkyqG6hA3AFBUAmCAxgDYCGaOArgHYMzARc46GGxgAJGDDABlBFABucgBQBvKnDiRYAGnVwO6DLo0swYXQF8AXHDUatMG1w4gARnLgAfITCjAuAObUGgYYAPw2AEqM0LQAPMJ+gdqIKGiYAHQAgmZMwAwsfAJeqaSZ0QCOHBjiLFy0THJxdQCeAHxtwXCmYBGl6ejZufmF-ILezkxM1BYAlDYACnggwIbNXO3UNMKiElKyCsp2mtCOcAAcAAzXxvqG6DbHGoTYEBAZACpIMIQ2SmgVFLpWZwAC8bVseg0GjQMA4UEEhFcbEoULgFj0GLmQA
- The repro: https://github.com/bodinsamuel/ts-workspace-typing-issue
git clone https://github.com/bodinsamuel/ts-workspace-typing-issue.git
cd ts-workspace-typing-issue
yarn
yarn tsc -b
$ /Users/samuelbodin/code/test-ts-workspace/node_modules/.bin/tsc -b
test2/index.ts:6:17 - error TS7006: Parameter 'req' implicitly has an 'any' type.
6 'foo.Txt': (req, res) => {
~~~
test2/index.ts:6:22 - error TS7006: Parameter 'res' implicitly has an 'any' type.
6 'foo.Txt': (req, res) => {
🙁 Actual behavior
Express req
and res
are typed as any
🙂 Expected behavior
Correct express typing