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

SPFx Copilot Components - doesnt run on CopilotWorkBench and not deployed to teams

Open joaojmendes opened this issue 4 months ago โ€ข 30 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

๐Ÿ’ฅ SharePoint Framework

Developer environment

macOS

What browser(s) / client(s) have you tested

  • [ ] ๐Ÿ’ฅ Internet Explorer
  • [x] ๐Ÿ’ฅ Microsoft Edge
  • [ ] ๐Ÿ’ฅ Google Chrome
  • [ ] ๐Ÿ’ฅ FireFox
  • [ ] ๐Ÿ’ฅ Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • SPFx version. 1.24.0-beta.2
  • Node.js version : v22.21.1

Describe the bug / error

I created a new Copilot Component; use the React Framework, and when tested in Copilot Workbench, the component does not show

Link to the project: https://github.com/joaojmendes/copilot-app-helloWorld

Image Image

Steps to reproduce

  1. Create a project with yo and select the Copilot component and React Framework
  2. Run npm start to open Copilot Workbench
  3. Select the tool, click "Fire Turn",
  4. In the console, we got some errors

The app does not show

Expected behavior

The App should be loaded and shown.

joaojmendes avatar Jul 12 '26 12:07 joaojmendes

Iโ€™m also experiencing the same error of @joaojmendes (same version / configuration).

fredupstair avatar Jul 12 '26 16:07 fredupstair

@joaojmendes / @fredupstair : please repro this and save the console log and network trace (HAR) file and share with me ([email protected]). We'll investigate and report back.

@nick-pape / @iclanton : FYI

jansenbe avatar Jul 12 '26 17:07 jansenbe

Iโ€™m also experiencing the same error of @joaojmendes (same version / configuration). State keeps on connecting and never loads the components. Getting errors in browser's console complaining All promises were rejected.

pragupt6 avatar Jul 14 '26 13:07 pragupt6

@pragupt6 : can you capture browser console logs (log file) and network trace (har file) and send to [email protected]. Thx!

jansenbe avatar Jul 14 '26 14:07 jansenbe

@jansenbe just sent you the file

Image

pragupt6 avatar Jul 14 '26 15:07 pragupt6

Thanks @pragupt6. Initial analysis showed your repro having the same root cause as the one shared by @fredupstair . Engineering is looking into this as we speak

jansenbe avatar Jul 14 '26 16:07 jansenbe

I also hit the same issue immediately. Hoping it gets resolved. I tried everything I could on my end aside from another machine. Is that worth a try since it works for some people? Thanks for the help!

React365-Chris avatar Jul 17 '26 01:07 React365-Chris

@React365-Chris : the issue has to with our service worker not getting properly installed, I'll check with engineering if there's some workarounds here. We're pushing out an update that will help but that takes some time to reach prod tenants, we're investigating if we can accelerate that deployment.

jansenbe avatar Jul 17 '26 09:07 jansenbe

Thanks for the update @jansenbe, really appreciated. Please let us know if you'd like us to run any other tests on our side. Iโ€™m available to help.

fredupstair avatar Jul 18 '26 07:07 fredupstair

Facing the same issue..

Image

ShanidGafoor avatar Jul 21 '26 06:07 ShanidGafoor

Same symptom here (1.24.0-beta.2, unmodified React scaffold fails identically to our own components), with a diagnostic that may help narrow it server-side:

The turn iframe's host page is being served as an empty shell. Each fired turn loads /_layouts/15/PortableComponent.aspx?...componentType=CopilotComponent..., and on our tenant that page returns HTTP 200 with ~252 bytes: a single inline timing script (g_duration etc.) in the head and a completely empty <body> โ€” no component bootstrap markup or scripts at all. The component bundle is never even requested, so the bridge handshake can't start. That's consistent with @jansenbe's service-worker note: the failure is upstream of anything client-side.

Quick check anyone can run from the browser console on an affected tenant (any authenticated SharePoint page):

fetch('/_layouts/15/PortableComponent.aspx?componentType=CopilotComponent', { credentials: 'include' })
  .then(r => r.text())
  .then(t => console.log('bytes:', t.length, 'body:', (t.match(/<body[^>]*>([\s\S]*?)<\/body>/i)?.[1] || '').trim().length));

On our tenant this prints bytes: ~252, body: 0 โ€” unchanged as of today (checked Jul 19, 21, 22).

Timeline detail that may be useful: on Jul 15 the Workbench auto-listed components (dev server running) and the console showed service-worker errors during the stall. Since Jul 19 the Workbench no longer auto-lists localhost components (?debugManifestsFile= is required), the service-worker console errors are gone, and the iframe now reaches "Iframe loaded" in the event log โ€” but PortableComponent.aspx still serves the empty shell, so the turn sticks at "Connecting".

Happy to send HAR + console logs to [email protected] if another repro is useful.

nolanhurlburt avatar Jul 22 '26 04:07 nolanhurlburt

Same here... still have the same errors ... :(

joaojmendes avatar Jul 27 '26 11:07 joaojmendes

@joaojmendes : still issues in workbench or in Copilot?

jansenbe avatar Jul 27 '26 11:07 jansenbe

Hi @jansenbe, I still have the same issue too.

fredupstair avatar Jul 27 '26 11:07 fredupstair

Still facing the issue in Copilot Component Workbench..

ShanidGafoor avatar Jul 27 '26 11:07 ShanidGafoor

Same here, issue remains unresolved. Why/how would this work for some and not others? Is there a configuration change that can be made so we can get started?

React365-Chris avatar Jul 27 '26 14:07 React365-Chris

@joaojmendes / @ShanidGafoor / @React365-Chris : can you reproduce the issue and capture the console log and network traffic (har file) and share with me via [email protected]. We've done multiple fixes for this, but most have not reached production yet (ETA and of next week). These traces will help engineering confirm their fixes are covering all the scenarios. Thx!

jansenbe avatar Jul 28 '26 07:07 jansenbe

@jansenbe , Here are the console logs and HAR file! I have errors on Workbench. I am trying to get it working first on Workbench before testing on Copilot. I tested in 2 different tenants; same results.

Thank you, @jansenbe

logs.zip

joaojmendes avatar Jul 28 '26 13:07 joaojmendes

I can confirm I also get the same experience and happy to help test in anyway.

Thanks for all the hard work @jansenbe and @VesaJuvonen. ๐Ÿ’œ๐Ÿงก

PopWarner avatar Jul 28 '26 15:07 PopWarner

@joaojmendes / @React365-Chris / @PopWarner / @fredupstair / @pragupt6 / @nolanhurlburt / @ShanidGafoor

Can you verify if your account or your tenant is set to use targeted release? If not, can you try setting your user or tenant in targeted release and see if that makes a difference?

Image

jansenbe avatar Jul 29 '26 17:07 jansenbe