File paths in node.js site

First time building a big project using node.js.

I want to use echarts.js since Wappler charts does not suite my needs with the project.

I created a js folder in the public folder and added the echarts.js file there like this:

Screenshot 2021-11-23 at 07.14.22

On my content page I added the script link and the test graph displays in Wappler but does not when opening the web page in the browser. Please help me fix this so graph will display on live page. Thanks

1 Like

Do you see any errors in the browser console?
What if you add console.log('script loaded'); at the very first line of your js file and load the page in the browser? Do you see the output in the console?

This is all I get in the console. No other errors:

These errors are not related and not really anything to be worried about.
Can you please send me a screenshot of what you see when you right click your page and select View Page Source?

1 Like

What i meant was to put this in the js file, not on the page …

Screenshot_2

Also if your project paths are root relative, your link should start with a /

I cannot save the echarts.js file if I copy that code into first line.

changed the link to / since project paths are root relative but still not working

Also i see that you have two elements using the same id="main" on your page, which is probably causing the issue.

Because you are using some weird quotes there. It must be:

console.log('loaded');

single quotes.

Good catch @Teodor. Thanks!