tradingview / charting-library-examples

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

Module not found: Can't resolve '../../charting_library/charting_library.min' #198

Closed OnePieceLiu closed 3 years ago

OnePieceLiu commented 3 years ago

./src/components/TVChartContainer/index.tsx Module not found: Can't resolve '../../charting_library/charting_library.min' in 'C:\Users\lz\Desktop\charting-library-examples-master\react-typescript\src\components\TVChartContainer'

timocov commented 3 years ago

What version of the library you use?

sschiessl-bcp commented 3 years ago

Hello there,

I am running in the same problem using the react-javascript example. I use the latest charting_library (commit hash 02b61a1). It does not contain a min version, and I tried without min as well.

To get one step further you can put the charting_library e.g. in src/lib/ and then change the import to

import { widget } from '../../lib/charting_library/charting_library.min';

Then you run into this error image

Are the examples compatible with latest library?

sschiessl-bcp commented 3 years ago

I added https://github.com/tradingview/charting-library-examples/issues/36#issuecomment-411023104 to the library js, now I see this error image

Any fixes here I might have overlooked? Any help or pointers is appreciated @timocov

ikh00000 commented 3 years ago

just try this import: import { widget } from './charting_library/charting_library';

and also add / eslint-disable / at the top of this file to the file from './charting_library/charting_library';

For me it works!

sschiessl-bcp commented 3 years ago

just try this import: import { widget } from './charting_library/charting_library';

and also add / eslint-disable / at the top of this file to the file from './charting_library/charting_library';

For me it works!

Thanks for commenting! Which commit hash did you use for the charting_library, and are you running an otherwise unchanged copy of the react-javascript example? I did what you suggested, but it does not work for me and I am running into the error widgetReady (see above) ...

aminkhorrami commented 3 years ago

same problem here !

option-i commented 3 years ago

I had same problem. the react-javascript is out of date. I did this and it worked. image

timocov commented 3 years ago

We're on the way to update all examples to use the latest version of charting_library, see #207.

timocov commented 3 years ago

Fixed in #207