On developing the SharePoint Framework web part, we may receive the below error message SPFxon loading the web part in the page.

[SPLoaderError.loadComponentError]:

***Failed to load component “2a602d35-fbae-40d3-80f3-4a2afa1e514b” (HelloWorldWebPart).
Original error: ***Failed to load entry point from component “2a602d35-fbae-40d3-80f3-4a2afa1e514b” (HelloWorldWebPart).
Original error: Error loading https://component-id.invalid/2a602d35-fbae-40d3-80f3-4a2afa1e514b_0.0.1
Cannot find module “@ms/sp-telemetry”

***INNERERROR:
***Failed to load entry point from component “2a602d35-fbae-40d3-80f3-4a2afa1e514b” (HelloWorldWebPart).
Original error: Error loading https://component-id.invalid/2a602d35-fbae-40d3-80f3-4a2afa1e514b_0.0.1
Cannot find module “@ms/sp-telemetry”
***CALLSTACK:
Error
at SPError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:10183:9)
at SPLoaderError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:4211:9)
at ErrorBuilder.buildErrorWithVerboseLog (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:3821:9)
at ErrorBuilder.buildLoadComponentError (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:3743:9)
at Anonymous function (https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js:7952:9)

Root Cause:
The above issue may raise due to the incorrect reference in the code. For me I have tried to call the webpartcontext code and I have use the below references in the code.


import IWebPartContext from '@microsoft/sp-webpart-base/lib/core/IWebPartContext';
import SPHttpClient from '@microsoft/sp-http/lib/spHttpClient/SPHttpClient';

Solution:
To resolve the issue, I have added the below references by replacing the above code


import { IWebPartContext } from '@microsoft/sp-webpart-base';
import { SPHttpClient } from '@microsoft/sp-http';


3 Comments

nitish · July 19, 2018 at 10:24 PM

Thanks Shantha . It resolved my issue.

raj · October 24, 2018 at 11:21 PM

interesting i have same issue however I am not sure where to replace it. I am not a developer and not sure how to use the code from GitHub for content-query-webpart
https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-content-query-webpart

I am getting error after adding it to a page.
[SPLoaderError.loadComponentError]:

***Failed to load component “ac515af1-4490-4c7b-8191-d49b41b26c5e” (ContentQueryWebPart).

Original error: ***Failed to load URL ‘https://localhost:4321/lib/webparts/contentQuery/loc/en-us.js’ for resource ‘contentQueryStrings’ in component ‘ac515af1-4490-4c7b-8191-d49b41b26c5e’ (ContentQueryWebPart). There was a network problem.

Can you please help me?

    Shantha Kumar · October 27, 2018 at 9:13 PM

    Kindly share which version of SPFx version you are using for developing the webpart.

Leave a Reply

Your email address will not be published. Required fields are marked *