porting into:  

[ ![Capture1](https://global.discourse-
cdn.com/freecodecamp/original/3X/8/d/8d529eb0c3a464ec941a60b39eba59d7dd2c75ed.png)
Capture1  778×610 18.3 KB  ](https://global.discourse-
cdn.com/freecodecamp/original/3X/8/d/8d529eb0c3a464ec941a60b39eba59d7dd2c75ed.png
"Capture1")

you see what i mean , because i use VSCODE and the html i created that import
an exported function in a js file , does not work when i open it in chrome,
and empty page appears.

[ anon22924398  ](https://forum.freecodecamp.org/u/anon22924398) December 16,
2021, 4:28pm  8

I see… Did you create a live server in vscode? Otherwise the files will never
be loaded.

1 Like

[ zak  ](https://forum.freecodecamp.org/u/zak) December 16, 2021, 5:30pm  9

first time I hear about a live server in vscode, no.  
you should know that I tried document.getElementById… a string on the page and
I can see results on the chrome, it works fine until I put type=‘module’ in a
script tag and try to call an exported function than the page goes blank when
reloaded.  
is it the Microsoft version or the browser version or what is causing this?
because almost all famous websites and all the google searches show the same
way to do it.

[ bbsmooth  ](https://forum.freecodecamp.org/u/bbsmooth) December 16, 2021,
5:53pm  10

JS Modules can only be loaded from a web server, so if you are merely opening
the HTML file in your browser directly from your filesystem then the module
file won’t load. The Live Server VSCode extension provides a web server for
you so that you can run your HTML page through it and thus be able to load a
module.

[ zak  ](https://forum.freecodecamp.org/u/zak) December 16, 2021, 6:09pm  11

So how to do that? Just trust the google search?  
You mentioned extension, should i just go to extension search of vscode and
install one?  
Any advice on how it works once installed?  
Thank you.

[ bbsmooth  ](https://forum.freecodecamp.org/u/bbsmooth) December 16, 2021,
6:18pm  12

I would start at the [ Live Server web page
](https://ritwickdey.github.io/vscode-live-server/) .

[ zak  ](https://forum.freecodecamp.org/u/zak) December 16, 2021, 6:35pm  13

i insteled it, opened my html file with live server I got a page opened with
this address: [ listing directory / ](http://127.0.0.1:5500/)  

[ ![5555](https://global.discourse-
cdn.com/freecodecamp/optimized/3X/7/f/7fd9568a443096139504826a8df24525a4ff69ff_2_554x499.png)
5555  1070×965 12.1 KB  ](https://global.discourse-
cdn.com/freecodecamp/original/3X/7/f/7fd9568a443096139504826a8df24525a4ff69ff.png
"5555")

I have to mention that when I clicked on go live, they provided to choose a
folder up in the search bar I have chosed a different directory from 5he one
project is in , so probably that’s why page is loaded like that, I don’t know
how to change the directory the sever goes live from.

[ zak  ](https://forum.freecodecamp.org/u/zak) December 16, 2021, 7:42pm  14

That’s it, it found out the problem, it’s a mistake i made by importing both
on a second js file and on html script.  
I commented the import statement on the js file, the live servered page was
giving results. Thank you.

1 Like

[ system  ](https://forum.freecodecamp.org/u/system) Closed  June 17, 2022,
7:42am  15

This topic was automatically closed 182 days after the last reply. New replies
are no longer allowed.

  * [ Home ](/)
  * [ Subforums ](/categories)
  * [ FAQ/Guidelines ](/guidelines)
  * [ Terms of Service ](https://www.freecodecamp.org/terms)
  * [ Privacy Policy ](https://www.freecodecamp.org/privacy)

Powered by [ Discourse ](https://www.discourse.org) , best viewed with
JavaScript enabled