You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ts-node REPL: error on multiline function arguments #1667
Functions with arguments declared in one line work in ts-node REPL:
> ts-node
> function myFn(a: string, b: string) {
... console.log(a, b)
... return a
... }
undefined
> myFn('test', '!')
test !
'test'
Trying to paste function with multline arguments declaration into ts-node REPL:
function myFn2(
a: string,
b: string
) {
console.log(a, b)
return a
}
result:
> ts-node
> function myFn2(
<repl>.ts:9:10 - error TS2391: Function implementation is missing or not immediately following the declaration.
9 function myFn2(
~~~~~
<repl>.ts:9:10 - error TS7010: 'myFn2', which lacks return-type annotation, implicitly has an 'any' return type.
9 function myFn2(
~~~~~
<repl>.ts:10:1 - error TS1005: ')' expected.
Activity
[-]Multiline function arguments[/-][+]ts-node: error on multiline function arguments[/+][-]ts-node: error on multiline function arguments[/-][+]ts-node REPL: error on multiline function arguments[/+]cspotcode commentedon Mar 2, 2022
I'm guessing you are hitting a limitation in our known set of
RECOVERY_CODES:ts-node/src/repl.ts
Lines 671 to 683 in 30f03e1
Fix TypeStrong#1667 multiline function arguments support in REPL
Fix TypeStrong#1667 multiline function arguments support in REPL
Fix TypeStrong#1667 multiline function arguments support in REPL
d9k commentedon Mar 4, 2022
@cspotcode, created #1677 pull request
Fix #1667 multiline function arguments support in REPL (#1677)
Update dependency ts-node to v10.8.0 (#1367)