我想在我的项目中集成交易视图库,但出现此错误

i want to integrate trading view library in my project but this error comes

我遇到了这个错误

TypeError: 无法读取未定义的属性(读取 'UDFCompatibleDatafeed')

我删除了我的项目并克隆了他们的项目,然后我按照这些提到的步骤进行操作,然后是 运行

后来我发现了问题

所以在我们的项目中,我错过了 index.html 中的两个脚本,然后它会在 运行ning 上给出这个错误,所以克隆项目,然后按照你的特定框架或库的提及步骤

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <script src="%PUBLIC_URL%/datafeeds/udf/dist/polyfills.js"></script>
        <script src="%PUBLIC_URL%/datafeeds/udf/dist/bundle.js"></script>
        <title>Charting Library React Demo</title>
    </head>
    <body>
        <noscript>
            You need to enable JavaScript to run this app.
        </noscript>
        <div id="root"></div>
        <!--
            This HTML file is a template.
            If you open it directly in the browser, you will see an empty page.
            You can add webfonts, meta tags, or analytics to this file.
            The build step will place the bundled scripts into the <body> tag.
            To begin the development, run `npm start`.
            To create a production bundle, use `npm run build`.
        -->
    </body>
</html>

在index.html/public文件夹中导入这两个脚本

 <script src="%PUBLIC_URL%/datafeeds/udf/dist/polyfills.js"></script>
 <script src="%PUBLIC_URL%/datafeeds/udf/dist/bundle.js"></script>