tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.4k stars 765 forks source link

Demo Page infinite loop render when url contains path subroutes #1

Closed DubiEX closed 6 years ago

DubiEX commented 6 years ago

Hi,

I found a really weird bug, I cloned the repo and copied the required folders to a public folder, everything is working fine, but when I put /something/ in the url then page seems to loop itself forever. Here's how it looks.

ezgif com-gif-maker

I put the alert inside the bundle file to show that the whole script is called multiple times when there's subroute in url. here's where I put it.

alertishere

I'm using the latest tradingView lib version (1.12) I didn't make any modifications other than putting that alert in bundle. Problem is also present on Firefox. I'm developing on Windows machine.

Would like to know how to fix that or any workaround because my page depends on what tokens are in url to determine what data should chart show and this issue prevents me from integrating TradingView.

I also found the same behaviour using fresh create-react-app app HERE

ezhukovskiy commented 6 years ago

Hi, yes, it is a bug in create-react-app that returns the default page if an incorrect URL is entered. If you use another HTTP server than create-react-app, you won't have this error. If you know how to fix it, please make a PR.