无法从组件(IE)加载条目-Sharepoint SPFX

时间:2019-12-12 11:15:53

标签: sharepoint spfx

我在IE上运行此错误,在Chrome等上正常运行。

[SPLoaderError.loadComponentError]:
***Failed to load component "3aac0bde-0ef1-46a1-a7f4-216112d395d5" (CompactCustomListWebPart). Original error: ***Failed to load entry point from component "3aac0bde-0ef1-46a1-a7f4-216112d395d5" (CompactCustomListWebPart). Original error: Error loading https://component-id.invalid/3aac0bde-0ef1-46a1-a7f4-216112d395d5_0.0.1
 https://component-id.invalid/3aac0bde-0ef1-46a1-a7f4-216112d395d5_0.0.1 did not call System.register or AMD define. If loading a global module configure the global name via the meta exports property for script injection support.

***INNERERROR:
***Failed to load entry point from component "3aac0bde-0ef1-46a1-a7f4-216112d395d5" (CompactCustomListWebPart). Original error: Error loading https://component-id.invalid/3aac0bde-0ef1-46a1-a7f4-216112d395d5_0.0.1
 https://component-id.invalid/3aac0bde-0ef1-46a1-a7f4-216112d395d5_0.0.1 did not call System.register or AMD define. If loading a global module configure the global name via the meta exports property for script injection support.
***CALLSTACK:
Error
   at t._generateErrorStackForIE (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:4:53963)
   at t (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:4:53499)
   at t (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:20:118832)
   at e.buildErrorWithVerboseLog (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:20:128525)
   at e.buildLoadComponentError (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:20:124550)
   at Anonymous function (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:20:115044)
   at Anonymous function (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:1:16156)
   at F (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:1:16132)
   at C (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:1:15977)
   at B (https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_6c1243ef07241a9f41fe54d8c7adbc98.js:1:15565)

我已将gulp clean合并到构建脚本中,因此它始终在构建之前进行清洁。

有人建议外部CDN对Fabric的引用导致了此问题?我要如何自己打包?

也许是sp Web pnp js导入使用了较新的东西-我是否需要向使用sp的每个tsx文件或仅mainwebpart.ts中添加多边形填充? import '@pnp/polyfill-ie11';https://pnp.github.io/pnpjs/documentation/polyfill/

1 个答案:

答案 0 :(得分:0)

您只需在[webpartname] .ts文件中使用import '@pnp/polyfill-ie11';!因此,在您的应用程序的入口点!从那里将其导入到整个应用程序中,并且可以使用polyfills!

乔,问候