sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Unable to add SPFx web part to classic page in RC0

Open zplume opened this issue 9 years ago • 26 comments

Category

  • [ ] Typo
  • [ ] Question
  • [x] Bug
  • [ ] Enhancement / Suggestion
  • [ ] Additional article idea

Expected or Desired Behavior

SPFx web parts can be added to a classic page in RC0

Observed Behavior

SPFx web parts cannot be added to a classic page in RC0

Steps to Reproduce

  • Create an SPFx web part using RC0 drop / yo generator
  • Update "config\write-manifests.json" to specify a CDN path in SharePoint, e.g. "https://tenantname.sharepoint.com/sites/assets/style library/spfx"
  • "gulp --ship"
  • "gulp bundle --ship"
  • "gulp package-solution --ship"
  • Upload "sharepoint\solution\appname.sppkg" to SPO app catalog
  • Upload contents of "temp\deploy" to a SPO site collection (e.g. "https://tenantname.sharepoint.com/sites/assets/style library/spfx/")
  • Install app on a test site via site contents page
  • Edit the home page of the site (a wiki page)
  • Open the insert web part menu
  • The SPFx web part is not available to be added to the page (I also checked the insert app part menu)

Thanks

zplume avatar Jan 12 '17 15:01 zplume

Is the webpart available on "modern" pages?

patmill avatar Jan 12 '17 18:01 patmill

Yes the web part is available for selection on modern pages. However I get the following error when adding the webpart to the page: [SPWebPartErrorCode.ScriptLoadError]:: Unable to load web part WebPart.HelloWorldWebPart.cde5d690-cc72-4800-a31d-e24c91fa37e5,Error: Error: Unable to load script https://tenantname.sharepoint.com/sites/Assets/SPFx/HelloWorld/hello-world.bundle Error loading https://component-id.invalid/45177f7a-648e-4c87-9c08-8386e41e2422 script resources due to: undefined. CALLSTACK:: Error at t [as constructor] (https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-client-base_en-us_a666e7641ac07e434cbbc25b9a2ae3f1.js:48:12396) at new t (https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-webpart-base_en-us_5ade5685acecf1283a7a0e6fafc6dd2c.js:47:21044) at Function.t.create (https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-webpart-base_en-us_5ade5685acecf1283a7a0e6fafc6dd2c.js:47:21457) at https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-webpart-base_en-us_5ade5685acecf1283a7a0e6fafc6dd2c.js:47:30989

I'm attempting to use SharePoint as the CDN (see URL in error above). I notice that when I try and open the 45177f7a-648e-4c87-9c08-8386e41e2422.json file from SharePoint by clicking its name in the modern UI, I get a "File not Found" error. I can download the file successfully though, so it's definitely there. I notice that .json is a blocked file type in SharePoint (https://support.office.com/en-us/article/Types-of-files-that-cannot-be-added-to-a-list-or-library-30be234d-e551-4c2a-8de8-f8546ffbf5b3) - does this mean it's not possible to use SharePoint as the host for SPFx web parts?

Thanks

zplume avatar Jan 13 '17 11:01 zplume

I tried adding another SPFx web part to a modern page where the app is installed in the same site and the web part is configured to load from localhost (rather than from CDN). I made sure "gulp serve" was running, but I get the following error when adding the web part to the modern page:

[SPWebPartErrorCode.ScriptLoadError]:: Unable to load web part WebPart.HelloWorld2WebPart.bac135b5-19d6-4257-9f9a-c8944ea8b2fc,Error: Error: Unable to load script https://localhost:4321/hello-world2.bundle Error loading https://component-id.invalid/d145bd52-9ec8-42d1-aac0-5751ae4b9ba1 script resources due to: undefined. CALLSTACK:: Error at t [as constructor] (https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-client-base_en-us_a666e7641ac07e434cbbc25b9a2ae3f1.js:48:12396) at new t (https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-webpart-base_en-us_5ade5685acecf1283a7a0e6fafc6dd2c.js:47:21044) at Function.t.create (https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-webpart-base_en-us_5ade5685acecf1283a7a0e6fafc6dd2c.js:47:21457) at https://spoprod-a.akamaihd.net/files/sp-client-prod_2016-11-28.016/sp-webpart-base_en-us_5ade5685acecf1283a7a0e6fafc6dd2c.js:47:30989

zplume avatar Jan 13 '17 12:01 zplume

Ah, looking at your tweet and the URLs in the errors above, it looks like RC0 isn't on the tenant yet: https://twitter.com/PatMill_MSFT/status/819613473168465925

zplume avatar Jan 13 '17 12:01 zplume

We increased the rollout a bunch today, with the rest likely being upgraded early next week.

patmill avatar Jan 14 '17 01:01 patmill

Ah great, I just retested:

  • The web part loads successfully on a modern page
  • I can't select the web part to add it to a classic (wiki) page via either insert > app part or insert > web part (it's not listed) Both tests above were performed on the same site with the app installed via site contents.

Using SP as the CDN works, which is good news :)

Thanks

zplume avatar Jan 14 '17 20:01 zplume

For me it's not working for classic and modern pages. Anyone have any update? How can i see my webpart in Webpart list ..: Please see my issue in
https://github.com/SharePoint/sp-dev-docs/issues/353

VidhiBartariya avatar Jan 16 '17 13:01 VidhiBartariya

I am having a similar issue with web parts on classic pages. The site is running RC0 as confirmed by the "2017" version scripts running on _layouts/15/workbench.aspx.

Using the latest RC0 bits to build the webpart, install to the store, and install to the site. The web part is not listed in the web parts list when adding a web part to the page.

Also, web parts that were previously installed and then removed are still showing in the web parts list.

jaredbuttars avatar Jan 16 '17 20:01 jaredbuttars

Hi @jaredbuttars - what container are you looking for the new webparts in for your classic page scenario?

patmill avatar Jan 16 '17 21:01 patmill

@patmill I'm looking under "Custom"

jaredbuttars avatar Jan 16 '17 21:01 jaredbuttars

Currently on my phone, so I'm not exactly sure what the name is. Can you check the rest of them? Is there one called "under development"?

Get Outlook for iOShttps://aka.ms/o0ukef


From: jaredbuttars [email protected] Sent: Monday, January 16, 2017 1:37:39 PM To: SharePoint/sp-dev-docs Cc: Pat Miller (SHAREPOINT); Mention Subject: Re: [SharePoint/sp-dev-docs] Unable to add SPFx web part to classic page in RC0 (#343)

@patmillhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpatmill&data=02%7C01%7CPat.Miller%40microsoft.com%7C870b3e50d2f5492537b808d43e57e5eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636201994616451903&sdata=%2FB1ZSM3tb2AbRUC99u0Uf2T%2BTXXz8VLPbBeusuvSxl0%3D&reserved=0 I'm looking under "Custom"

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F343%23issuecomment-272967707&data=02%7C01%7CPat.Miller%40microsoft.com%7C870b3e50d2f5492537b808d43e57e5eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636201994616451903&sdata=cazPzwM05RoY4TIfka%2Bdm280x8aC1JF73d1iNNp75cc%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADl-SRoq0MMv8AuYOwyAwmWdS3YZ2kHcks5rS-MjgaJpZM4Lh2RY&data=02%7C01%7CPat.Miller%40microsoft.com%7C870b3e50d2f5492537b808d43e57e5eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636201994616451903&sdata=p%2FcoHwGlyvrnWIgeroAUacZFwm2F8ePSlRJ1GkIM1Y0%3D&reserved=0.

patmill avatar Jan 16 '17 23:01 patmill

There is no "under development" folder.

jaredbuttars avatar Jan 17 '17 00:01 jaredbuttars

Ok, super weird. My test suite was working on Friday (I have a classic page with the web part in it) but now I can't add another one. So, you aren't doing anything wrong - we are.

We will look into this tomorrow AM. In the mean time, you can test on a modern page. If you go to the site pages list view, selecting "new" then "site page" should get you a modern page.


From: jaredbuttars [email protected] Sent: Monday, January 16, 2017 4:13:32 PM To: SharePoint/sp-dev-docs Cc: Pat Miller (SHAREPOINT); Mention Subject: Re: [SharePoint/sp-dev-docs] Unable to add SPFx web part to classic page in RC0 (#343)

There is no "under development" folder.

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F343%23issuecomment-272990135&data=02%7C01%7CPat.Miller%40microsoft.com%7C33aaf700ee2b428a892f08d43e6dad7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636202088189213810&sdata=qM%2FfCME1xWP7NUwB95ebn7JvxPDF9DYgFrIZ8Rgu66o%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADl-Saw0rAtjw74AsSproR7ig2QfhUPRks5rTAesgaJpZM4Lh2RY&data=02%7C01%7CPat.Miller%40microsoft.com%7C33aaf700ee2b428a892f08d43e6dad7d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636202088189213810&sdata=71jRRHU2TI79eUFhFeNVXLUy5rA89HqFoU4dbgmN8eE%3D&reserved=0.

patmill avatar Jan 17 '17 00:01 patmill

BTW I think that this is a problem with APPS being deployed through the APP Store and not through the Developer Site. Apps deployed straight into the developer site work fine in both modern and classic pages and the .webpart file is deployed to the web part gallery. The grouping that it's located in is under "Under Development". The moment you add the app to the site collection of an app deployed via the APP store, the .webpart file is not deployed and only works in Modern Pages.

The reason some are finding the .webpart file is because it might be lingering from a previous deployment.

juanmlarios avatar Jan 17 '17 22:01 juanmlarios

We've sorted out the issue and it should be resolved. Can you try again and see if it is working? The webpart should be in the "under development" section.

patmill avatar Jan 18 '17 04:01 patmill

@patmill I tried redeploying the app (via the catalog)...

  • make minor change to app code
  • gulp bundle --ship
  • gulp package-solution --ship
  • delete app from site
  • remove app from recycle bin
  • remove app from 2nd stage recycle bin
  • update app catalog with new version of package
  • upload updated bundle js/json files
  • add app to site via site contents

...and still don't see the web part as an option in classic pages > insert web part > under development.

I'll try a developer site.

Thanks

zplume avatar Jan 18 '17 08:01 zplume

@patmill I've tried the following:

  • Remove the app from the app catalog Apps for SharePoint library
  • Create a developer site collection via https://tenantname-admin.sharepoint.com/_layouts/15/online/SiteCollections.aspx
  • Create a subsite within the developer site collection ("team site" template)
  • Upload the app package to the App Packages library in the developer site collection
  • Navigate to the Apps in Testing library in the developer site collection
  • Clicked the "new app to deploy" link
  • Selected the app package that I uploaded
  • Left the "Deploy app to" URL at its default value (the URL of the developer site collection)
  • Clicked Deploy

This results in the error "Sorry, something went wrong. Client Side Solutions cannot be used in this location."

  • I tried setting the "Deploy app to" URL to the URL of the subsite - this resulted in the same error.
  • I tried setting the "Deploy app to" URL to the URL of another site collection - this resulted in the error "The install URL should reside within the Dev site collection."

Thanks

zplume avatar Jan 18 '17 12:01 zplume

+Graham


From: zplume [email protected] Sent: Wednesday, January 18, 2017 4:06:41 AM To: SharePoint/sp-dev-docs Cc: Subscribed Subject: Re: [SharePoint/sp-dev-docs] Unable to add SPFx web part to classic page in RC0 (#343)

@patmillhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpatmill&data=02%7C01%7Cmanishga%40exchange.microsoft.com%7Cc2fac9652c714df3954908d43f9a7790%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636203380043831472&sdata=o%2BvV2Xckpx%2B%2B3%2BWzlG9rf0O21yfxX2jEIb4RNclH6z0%3D&reserved=0 I've tried the following:

This results in the error "Sorry, something went wrong. Client Side Solutions cannot be used in this location."

  • I tried setting the "Deploy app to" URL to the URL of the subsite - this resulted in the same error.
  • I tried setting the "Deploy app to" URL to the URL of another site collection - this resulted in the error "The install URL should reside within the Dev site collection."

Thanks

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F343%23issuecomment-273458948&data=02%7C01%7Cmanishga%40exchange.microsoft.com%7Cc2fac9652c714df3954908d43f9a7790%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636203380043831472&sdata=8trs%2FLtNKKJr2%2Fxx6pa4sVltmY9z%2Fm4SeIXVjDNhFoE%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB3DfxFLbdHmRcp4ZkYtFCsqf6k-Zoyfks5rTgBRgaJpZM4Lh2RY&data=02%7C01%7Cmanishga%40exchange.microsoft.com%7Cc2fac9652c714df3954908d43f9a7790%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636203380043831472&sdata=Sm1yLCWa4V4JLzymzffaPn1%2FMxWKuVLG1mhinSkWKEM%3D&reserved=0.

manishgarg1 avatar Jan 18 '17 16:01 manishgarg1

I'm still experiencing this problem. There is no "Under Development" folder in the web part gallery and old, completely uninstalled web parts are still listed within the "Custom" folder - of course listed but not functional.

jaredbuttars avatar Jan 18 '17 17:01 jaredbuttars

OK, one last time. Apparently some tenants didn't get the fix - can you check one last time?

patmill avatar Jan 18 '17 23:01 patmill