[SPLoaderError.loadComponentError]: ***Failed to load component

Copper Contributor

I created a new SPFx project and then manually start adding the files from one my previous blog posts (Abstract Factory), which was created using a previous version of the generator not 1.4.1

 

I added all files and when I do gulp build, it builds without errors

 

The entire code  is here: just download it and run gulp serve.

https://github.com/levalencia/sp-dev-fx-webparts/tree/designpatternsfirstpart/samples/designpatterns...

 

The complete error is this:

[SPLoaderError.loadComponentError]:
***Failed to load component "1033059f-66e4-4146-81ad-4206ede72708" (AbstractFactoryWebPart).
Original error: ***Failed to load entry point from component "1033059f-66e4-4146-81ad-4206ede72708" (AbstractFactoryWebPart).
Original error: Error loading https://component-id.invalid/1033059f-66e4-4146-81ad-4206ede72708_0.0.1
	Object prototype may only be an Object or null: undefined

***INNERERROR:
***Failed to load entry point from component "1033059f-66e4-4146-81ad-4206ede72708" (AbstractFactoryWebPart).
Original error: Error loading https://component-id.invalid/1033059f-66e4-4146-81ad-4206ede72708_0.0.1
	Object prototype may only be an Object or null: undefined
***CALLSTACK:
Error
    at SPLoaderError.SPError [as constructor] (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:10183:24)
    at new SPLoaderError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:4211:28)
    at Function.ErrorBuilder.buildErrorWithVerboseLog (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:3821:21)
    at Function.ErrorBuilder.buildLoadComponentError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:3743:21)
    at https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:7952:38

Somebody from Microsoft: suggested to add this into config.json

"externals": {
    "@microsoft/sp-module-loader": "node_modules/@microsoft/sp-module-loader/dist/sp-module-loader.js"
  },

https://stackoverflow.com/questions/50143932/sploadererror-loadcomponenterror-failed-to-load-compone...

 

But that didnt work either.

 

 

 

 

 

0 Replies