tradingview / charting-library-examples

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

Charts not working in React production build (yarn build/serve) #195

Closed umarsa closed 3 years ago

umarsa commented 3 years ago

Checklist

I have downloaded the examples from this repo and the charts seem to work just fine when running locally using yarn start. Once you create a production build (yarn build), the resulting web app does not have working charts.

image

Left is "yarn start". Right is "yarn build", "serve-s build"

To Reproduce

Steps to reproduce the behavior:

  1. Clone the repo
  2. Copy the trading view library folder and other files as per instructions.
  3. Go to 'react-javascript.' folder
  4. Run 'yarn start'
  5. Observe working charts
  6. Stop local development server. Run 'yarn build' then 'serve -s build'
  7. Observe unexpected behaviours - non-working charts.

Expected behavior

The charts should work in both scenarios.

Screenshots

See above

Additional context

No additional context

timocov commented 3 years ago

https://github.com/tradingview/charting-library-examples/issues/15#issuecomment-411001758