Forum Discussion

ofergalinIsrael's avatar
ofergalinIsrael
Copper Contributor
Jun 22, 2024

workbench.aspx break when clicking "Preview"

On every web part I develop, running in /_layouts/15/workbench.aspx of all tenants I have access to, clicking the preview to debug, causes an error:

"Uncaught Error Error: The value for "domElement" must not be null
at e.isNotNullOrUndefined (res-1.cdn.office.net/files/sp-client/sp-webpart-workbench-assembly_en-us_a25d16d016d17db18ed91fbf7b537caf.js:20:183787"

 

I see it was reported in https://stackoverflow.com/ but no explanation or solution.

Please fix our workbench! Lots of SPFx developers are stock now.

Thank you

 

  • abdul-alhariri's avatar
    abdul-alhariri
    Copper Contributor
    I'm having same problem. it seems React version issue. If started a web part without using react, it works fine!
  • ofergalinIsrael Craig-Pulliam abdul-alhariri 

     

    Try this:

    1. Create a site page in any of your SharePoint site for testing SPFx web part
    2. After running gulp serve command, instead of using workbench URL, use URL like: 
      https://contoso.sharepoint.com/sites/MySite/SitePages/TestingPageName.aspx?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js

    Similar threadSPFx workbench crashes when I try to enter "Preview" mode 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • ofergalinIsrael's avatar
      ofergalinIsrael
      Copper Contributor

      ganeshsanap I know I can do this but there are limitations.

      Most My webparts are full page and deployed as app. So, development is best in the workbench.

      I found out I can work with it without hitting preview. 

      I just don't understand why MS can't figure a fi,x for a month now, to a product they brag about as a tool for SPFx.

       

       

    • ofergalinIsrael's avatar
      ofergalinIsrael
      Copper Contributor
      You and everyone else on this planet, which uses the workbench. 😒
      But since it has nothing to do with copilot, it is not important. 😊