我遵循quick start,并且创建了一个工作好的世界webpart。Sharepoint SPFX - 外部javascript加载问题
我想包括Twitter的插件,所以我跟着上添加外部JavaScript指导,this从Git的枢纽连接
我以下内容添加到我的config.json
"externals": {
"widgets":"https://platform.twitter.com/widgets.js"
},
和我用进口
import 'widgets';
不过,我得到以下错误
***Failed to load component "ab3668f3-39a2-4b40-a307-a1bea4023df9" (TwitterWebPart).
Original error: ***Failed to load URL 'https://platform.twitter.com/widgets.js' for resource 'widgets' in component 'ab3668f3-39a2-4b40-a307-a1bea4023df9' (TwitterWebPart). There was a network problem.
This may be a problem with a HTTPS certificate. Make sure you have the right certificate.
url https://platform.twitter.com/widgets.js
工作正常。