pnp / sp-starter-kit

Modern SharePoint Starter Kit - End-to-end showcase solution to get started with modern experiences.
MIT License
764 stars 536 forks source link

Links webpart ID issue #8

Closed krmoanh closed 6 years ago

krmoanh commented 6 years ago

Hi, I tried to use only links Webpart and its give me error loading always when I do gulp serve ?

[SPLoaderError.loadComponentError]: Failed to load component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Failed to load entry point from component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Error loading https://component-id.invalid/89978bff-19d9-4fbc-87bc-42ab73384dbf_0.0.1 Cannot find module "ControlStrings"

estruyf commented 6 years ago

@krmoanh can you check if the @pnp/spfx-controls-react dependency is installed? You should be there on the following path: node_modules/@pnp/spfx-controls-react.

krmoanh commented 6 years ago

Hi @estruyf thanks for replay. I already install both package and still the issue continue .

estruyf commented 6 years ago

I'm sure that you ran a npm install, but I want to be sure the path to the locale file which is failing exists or not. Could you please check if the following location exists: node_modules/@pnp/spfx-controls-react/lib/loc/.

krmoanh commented 6 years ago

@estruyf yes this is with PowerShell getting all the modules PS F:\akram\links> npm list --depth=0 links@0.0.1 F:\akram\links microsoft/sp-build-web 1.4.1 microsoft/sp-core-library 1.4.1 microsoft/sp-lodash-subset 1.4.1 microsoft/sp-module-interfaces 1.4.1 microsoft/sp-office-ui-fabric-core 1.4.1 microsoft/sp-webpart-base 1.4.1 microsoft/sp-webpart-workbench 1.4.1 pnp/spfx-controls-react 1.3.0 pnp/spfx-property-controls 1.6.0 types/chai 3.5.2 types/mocha 2.2.48 types/webpack-env 1.13.6 ajv 5.2.5 `gulp 3.9.1

estruyf commented 6 years ago

Ok, seems you have the wrong version. Do you use npm v5? Or an older version?

Can you try to install npm i @pnp/spfx-controls-react@next -S.

krmoanh commented 6 years ago

I just install it and test the webpart gulp serve and its give me this

[SPLoaderError.loadComponentError]: Failed to load component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Failed to load entry point from component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Error loading https://component-id.invalid/89978bff-19d9-4fbc-87bc-42ab73384dbf_0.0.1 Cannot find module "PropertyControlStrings"

krmoanh commented 6 years ago

The worldtime webpart and weatherInformation its work perfect for me. but i'm trying to use links webpart but it wont work

estruyf commented 6 years ago

Just pushed out a new major release for the React Controls. Can you update the @pnp/spfx-controls-react and @pnp/spfx-property-controls dependency versions in the package.json file to the following:

"@pnp/spfx-controls-react": "1.4.0",
"@pnp/spfx-property-controls": "1.6.0"
krmoanh commented 6 years ago

I update it both to spfx-controls-react": "1.4.0", pnp/spfx-property-controls": "1.6.0"

and its gives me after gulp serve

[SPLoaderError.loadComponentError]: Failed to load component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Failed to load entry point from component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Error loading https://component-id.invalid/89978bff-19d9-4fbc-87bc-42ab73384dbf_0.0.1 Cannot find module "PropertyControlStrings"

INNERERROR: Failed to load entry point from component "89978bff-19d9-4fbc-87bc-42ab73384dbf" (LinksWebPart). Original error: Error loading https://component-id.invalid/89978bff-19d9-4fbc-87bc-42ab73384dbf_0.0.1 Cannot find module "PropertyControlStrings" ***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

estruyf commented 6 years ago

On which type of machine are you running this? Node and NPM version?

Manually check if this path is correct: node_modules/@pnp/spfx-property-controls/lib/loc/. In the loc folder you should find a JS file.

krmoanh commented 6 years ago

@estruyf I already checked the node_modules/pnp/spfx-property-controls/lib/loc and also for react both are .js file are there. when I use the whole package of sp-starter-kit the links webpart works well. but what I need is im traying to use only the links webpart code not the whole sp-starter-kit same what I did in worldtime webpart and weatherInformation and its work fine for me. iam using windows 10 dell machine and when I start create the links webpart I choose react the second option. Node version is v6.12.3 , and NPM version is 3.10.10 .

estruyf commented 6 years ago

If I understand correctly, did you copy the code to a separate project? If you did that, you will have to do some configuration for the controls. Check the installation/configuration procedure for the property pane controls which you seem to be missing: https://sharepoint.github.io/sp-dev-fx-property-controls/#installation

krmoanh commented 6 years ago

yes that true. it was missing the configuration for the controls in config.json and now the webpart it works perfectly. thanks a lot estruyf