Forum Discussion
Custom Web Part Disappears
Hey Daniel can be a multitude of things. My first stop would be the Chrome developer tools... reload the page and look for any errors that may be related to your custom web part. It may be a resource file isn't found, it may be permissions, it may be a missing semi-colon :) Good luck!
- Daniel Lyons IIIApr 20, 2018Copper Contributor
Thanks for the suggestions!
I double checked the console but still don't see anything relevant. Chrome shows no errors, some depreciated property warning and some non-registered setting warnings, none of which appear related to the web part. The only error I see on the page is when running it in Safari which throws a 404 error for ActivityMonitor.js.map as well as the same warnings I see in Chrome. All of these errors and warnings show up on pages without the web part and on other sites in our tenant.
I'm not seeing anything that would indicate, to me at least, that there is a permission issue or missing resource. The part works as expected after adding it to the page - it's pretty simple and has three options that can be toggled on and off (one inserts a JavaScript and the other two insert CSS styles) and a full-width red div so I can see that it's actually there. I can save drafts, publish and edit the page and change the web part settings. I get the depreciated warnings on publish and edit but no errors. If I view the page in a different tab or browser the web part is not shown. However, if I come back to the original page (left open after publishing) the part is still there, if I edit the page it's still there and works normally. Refreshing the page or navigating away and back will make it disappear with no new warnings or errors. It doesn't appear to matter if the options are on or off.
I don't see any errors in Visual Studio Code and all of the semi-colons (as well as commas which I have a bad habit of forgetting in property lists when I'm in a hurry) appear to be where they should be.