0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you how to
0:04
resolve or fix the launch.json error
0:07
inside your VS code so when you try to
0:09
execute uh the JavaScript file directly
0:12
inside VS code this error basically
0:14
comes so you can see we have three files
0:17
here CSS and JavaScript we have this
0:20
JavaScript code that I want to execute
0:22
in the browser so what we generally do
0:25
we go to the run option right here there
0:28
is a option here start debugging so if
0:32
option you will be seeing this drop-down
0:35
here you need to select uh what sort of
0:38
application you're running so typically
0:39
it's a web application running on the
0:41
Chrome browser so as soon as you select
0:43
this option you will see this
0:47
file is automatically created in this VS
0:50
code folder dot VS code folder and you
0:52
basically see this error and your
0:54
application doesn't open in the browser
0:57
so it's really easy fix to easy step i
1:02
will show you in this video to resolve
1:03
this error the thing is that you don't
1:06
need this file so simply close this uh
1:10
folder and what we need to do you don't
1:13
need to directly open this JavaScript
1:15
file and run this what you need to do is
1:18
that simply close uh this JavaScript and
1:21
the CSS file just go to the HTML file
1:24
which needs to be executed in the
1:26
browser so by default all your web
1:29
applications are run through the HTML
1:31
file so now you need to run this file
1:34
and you just need to reference this
1:36
JavaScript in the CSS file in this HTML
1:39
file so you can simply include this by
1:46
tag and here you simply provide the path
1:49
here which is your style dot CSS and
1:52
similarly for JavaScript file as well
1:54
the script tag you simply include this
1:57
your JavaScript file so now
2:01
uh you simply go to the run option and
2:03
simply select start debugging and simply
2:06
select this it's a chrome application
2:09
and now you can see your application is
2:11
perfectly working this is your
2:13
JavaScript code executed this alert
2:15
world statement and this is appearing in
2:18
a red color because we actually
2:21
put I can change this color let's
2:26
green you can refresh you will See the
2:30
application is perfectly opening so the
2:32
thing is that you don't need to directly
2:35
run JavaScript file so this error
2:39
basically comes if you want to directly
2:41
run the JavaScript file and click on
2:43
this run start debugging and again this
2:46
error will come launch.json so the
2:50
actual fix that I showed you you don't
2:52
need to directly open this file simply
2:54
go to the HTML file and reference this
2:59
and after that you just again click this
3:02
run button and your application will
3:04
perfectly work so this is actually the
3:05
solution to this problem hopefully your
3:07
problem will be solved and please
3:10
comment on this video and also hit the
3:12
like button as well and also check out
3:15
freemediatools.com which contains