Skip to content

TS1108 "problem" showing on pure Javascript (node) file - Erroneous Error Flag #48224

@robertblum-psi

Description

@robertblum-psi

Issue Type: Bug

PROBLEMS pane shows:
[JS] file.js (1)
A 'return' statement can only be used within a function body. ts(1108) [400,5]

My node Javascript file is statements that call defined functions. These statements have an if statement that executes a return statement when true. The program is Javascript, and recognized as such by editor. There is no typescript in the environment. This bug appeared immediately after VS Code updated to February 2022 version (1.65.2). It did not appear in the previous version with the exact same file. The program runs properly on the target when run.

UPDATE: I have installed 1.64.2 to remediate issue. The problem does not occur down-level.

The program looks like this:

#!/usr/bin/env node
statements and function definitions
if ( x == y)
return
statements

A Typescript error should not show for a Javascript file.

VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:33:55.248Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6770HQ CPU @ 2.60GHz (8 x 2592)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.89GB (23.34GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (11)
Extension Author (truncated) Version
Bookmarks ale 13.2.4
bracket-pair-colorizer Coe 1.0.62
html-preview-vscode geo 0.2.5
vscode-pull-request-github Git 0.38.1
ibm-jcl kel 0.11.0
remote-wsl ms- 0.64.2
rexx nex 0.0.1
deepdark-material Nim 3.3.0
ayu tea 1.0.5
pdf tom 1.2.0
vscode-extension-for-zowe Zow 1.22.0

(17 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vsclayoutctrt:30451275
dsvsc009:30440023
pythonvspyt640:30450904
vscscmwlcmc:30438804
vscgsvid2:30447481
pynewfile477:30450038

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions