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

SPFX Field Customizer Extension not loading

Open veerasekarmeiyappan opened this issue 7 years ago • 29 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

On "Gulp serve" SPFX Field customizer should redirect to SP Site list view page and should render the field with prefix "Value:" in front of each field

Observed Behavior

On "Gulp serve" SPFX Field customizer redirected to SP Site list view as expected but didn't render the field with prefix "Value:" in front of each field. No errors or warnings found in page and VS code Terminal window

Steps to Reproduce

  1. Created a new SPFX Field Extension as in Microsoft site https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-field-customizer
  2. Opened in VS code
  3. Updated the PageURL in "serve.json". No extra code added.
  4. Ran "Gulp serve" in cmd
  5. Browser will open the SP Online site list view "allitems.aspx". Click "Load Debug Scripts" in the "Allow debug scripts" pop up window
  6. The list view will load as in OOTB view but the expected prefix will not be available

Submission Guidelines

Sure this is not a big bug as it has worked earlier for many users, may be a regression bug.

Thanks for your contribution! Sharing is caring.

veerasekarmeiyappan avatar Jul 26 '19 21:07 veerasekarmeiyappan

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Jul 26 '19 21:07 msft-github-bot

Same issue here.

kirkrd avatar Jul 29 '19 11:07 kirkrd

In your post @veerasekarmeiyappan, you said:

Updated the PageURL in "serve.json". No extra code added.

But that's not enough... in debug, the way your custom field customizer is associated with a field is by specifying which field it should be tied to. In the section debug your field customzier, step 8 says to " Update InternalFieldName attribute as Percent based on the field name, which we just created."

Of you don't do that, it won't attach the field customizer to your field.

andrewconnell avatar Jul 29 '19 14:07 andrewconnell

In your post @veerasekarmeiyappan, you said:

Updated the PageURL in "serve.json". No extra code added.

But that's not enough... in debug, the way your custom field customizer is associated with a field is by specifying which field it should be tied to. In the section debug your field customzier, step 8 says to " Update InternalFieldName attribute as Percent based on the field name, which we just created." Of you don't do that, it won't attach the field customizer to your field.

Thanks Andrew for your quick response. Apologies, I have missed to specify that in my steps. Yes I did update my field name "Percent" in the "InternalFieldName". Attached my serve.json image here.

serveJsonFile

veerasekarmeiyappan avatar Jul 29 '19 19:07 veerasekarmeiyappan

Wanted to keep you informed. I have raised one more issue same loading issue for SPFX ListView Command Set as well. https://github.com/SharePoint/sp-dev-docs/issues/4394

veerasekarmeiyappan avatar Jul 30 '19 16:07 veerasekarmeiyappan

Always helps if you can provide a link to a repo that contains the repro of this to help with testing... this goes for both your issues.

andrewconnell avatar Jul 30 '19 22:07 andrewconnell

I have the same issue.

RamPrasadMeenavalli avatar Jul 31 '19 07:07 RamPrasadMeenavalli

I have the same issue, a FieldCustomizer that worked fine last month doesn't work anymore (I rarely use it so I don't know when it broke). When using "gulp serve" and loading a test list, the js file is loaded, not errors appear in the console but still the customizer is not applied.

Request: '/temp/manifests.js' Request: '/lib/extensions/branding/loc/en-us.js' Request: '/lib/extensions/boldField/loc/en-us.js' Request: '/dist/google-command-set.js' Request: '/dist/branding-application-customizer.js' Request: '/dist/bold-field-field-customizer.js' <--- this is the Field customizer

If I set a breakpoint in onInit()/onRenderCell()/onDisposeCell(), the breakpoints are never hit. I have a webpart and an ApplicationCustomizer in the solution too and these 2 work (so the solution is loaded and the workbench connection works too).

Is there any trace log that I could enable to ensure SPO is loading the FieldCustomizer ?

jackpoz avatar Jul 31 '19 07:07 jackpoz

@andrewconnell I took the liberty of creating a repo here, hope this helps!

https://github.com/Kristofferkirk/field-customizer-extension-example-issue

kirkrd avatar Jul 31 '19 07:07 kirkrd

I was able to workaround the issue by replacing "&loadSPFX=true" in the url opened by "gulp serve" with "&loadSpfx=true" (notice how spfx is written in a different casing).

Longer explaination:

  • The javascript file that is supposed to load customizations from the workbench checks for query string parameters "loadSpfx", "customActions" and "fieldCustomizers" https://spoprod-a.akamaihd.net/files/odsp-next-prod_2019-07-19-sts_20190725.002/splistitemsscope-is-mini-455d2d6b.js
, m = p.getQueryParameter("loadSpfx")
, f = p.getQueryParameter("customActions")
, h = p.getQueryParameter("fieldCustomizers")
, g = m && (f || h);
  • g is evaluated as "loadSpfx && (customActions || fieldCustomizers)" .
  • Checking the return value of "p.getQueryParameter("loadSpfx")" in the console, it returns null. This looked strange as the url that "gulp serve" opens contains loadSPFX=true
  • Trying to call instead "p.getQueryParameter("loadSpfx")" in the console, it returned "true"
  • Trying to open the same url but this time replacing "&loadSPFX=true" with "&loadSpfx=true" loaded both a FieldCustomizer and a ListViewCommandSet that weren't loaded before.

I hope this will allow people to continue working while the bug is fixed either on SPO side or at "gulp serve" side

jackpoz avatar Jul 31 '19 11:07 jackpoz

I was able to workaround the issue by replacing "&loadSPFX=true" in the url opened by "gulp serve" with "&loadSpfx=true" (notice how spfx is written in a different casing).

Longer explaination:

  • The javascript file that is supposed to load customizations from the workbench checks for query string parameters "loadSpfx", "customActions" and "fieldCustomizers" https://spoprod-a.akamaihd.net/files/odsp-next-prod_2019-07-19-sts_20190725.002/splistitemsscope-is-mini-455d2d6b.js
, m = p.getQueryParameter("loadSpfx")
, f = p.getQueryParameter("customActions")
, h = p.getQueryParameter("fieldCustomizers")
, g = m && (f || h);
  • g is evaluated as "loadSpfx && (customActions || fieldCustomizers)" .
  • Checking the return value of "p.getQueryParameter("loadSpfx")" in the console, it returns null. This looked strange as the url that "gulp serve" opens contains loadSPFX=true
  • Trying to call instead "p.getQueryParameter("loadSpfx")" in the console, it returned "true"
  • Trying to open the same url but this time replacing "&loadSPFX=true" with "&loadSpfx=true" loaded both a FieldCustomizer and a ListViewCommandSet that weren't loaded before.

I hope this will allow people to continue working while the bug is fixed either on SPO side or at "gulp serve" side

Thanks a lot !!! Your workaround works !! Replacing "&loadSPFX=true" by "&loadSpfx=true" work for me ! Thanks

JonathanJourdan avatar Jul 31 '19 11:07 JonathanJourdan

I have the same issue, a FieldCustomizer that worked fine last month doesn't work anymore (I rarely use it so I don't know when it broke). When using "gulp serve" and loading a test list, the js file is loaded, not errors appear in the console but still the customizer is not applied.

Request: '/temp/manifests.js' Request: '/lib/extensions/branding/loc/en-us.js' Request: '/lib/extensions/boldField/loc/en-us.js' Request: '/dist/google-command-set.js' Request: '/dist/branding-application-customizer.js' Request: '/dist/bold-field-field-customizer.js' <--- this is the Field customizer

If I set a breakpoint in onInit()/onRenderCell()/onDisposeCell(), the breakpoints are never hit. I have a webpart and an ApplicationCustomizer in the solution too and these 2 work (so the solution is loaded and the workbench connection works too). Is there any trace log that I could enable to ensure SPO is loading the FieldCustomizer ?

@jackpoz , Fab. The workaround worked for me. You are a star. Thanks.

veerasekarmeiyappan avatar Jul 31 '19 21:07 veerasekarmeiyappan

@jackpoz - you are a wonderful person. I've forwarded the information, and it will help get a fix out. Can't thank you enough.

patmill avatar Aug 01 '19 17:08 patmill

Needed code changes have been now completed and we are currently internally validating situation. Fix will be rolling out to production in upcoming days/week. Until that happens, please use the workaround provided by @jackpoz. Thanks for sharing it! Sharing is caring!

VesaJuvonen avatar Aug 07 '19 11:08 VesaJuvonen

Needed code changes have been now completed and we are currently internally validating situation. Fix will be rolling out to production in upcoming days/week. Until that happens, please use the workaround provided by @jackpoz. Thanks for sharing it! Sharing is caring!

Sounds great.Thanks for making this Vesa

veerasekarmeiyappan avatar Aug 11 '19 08:08 veerasekarmeiyappan

Fix for this one is currently being rolled out and first tenants should have already received it. Full worldwide roll out takes roughly 1 more week, so please be patience.

VesaJuvonen avatar Aug 13 '19 07:08 VesaJuvonen

Fix should be fully deployed worldwide by Monday 19th of August. It's currently rolling out and some tenants are already fixed as they start using latest client side bits from our cloud. By next Monday, ALL tenants in SharePoint Online are fixed given the current estimates unless there's any additional surprises.

We are definitely internally having a root cause analyses discussions on how to avoid these kind of issues. Thanks everyone for being active on troubleshooting and also for providing temporary workaround. Sorry for the inconvenience this has caused.

Can't promise that these kind of human mistakes would not happen in future, but we are further working on minimizing possibility of it to happen and are making sure that internally this is being acknowledged and discussed.

Will close the issue latest on next Monday after getting confirmations that the issue is truly resolved.

VesaJuvonen avatar Aug 15 '19 07:08 VesaJuvonen

@VesaJuvonen said

Can't promise that these kind of human mistakes would not happen in future

Maybe if robots started doing the dev, there wouldn't be any human mistakes...

andrewconnell avatar Aug 15 '19 12:08 andrewconnell

Is this fixed? Upgraded to 1.9.1 and still have this problem.

TackJordy avatar Aug 19 '19 14:08 TackJordy

@TackJordy - this is not fixed in 1.9.1 client side bits as it's a fix which is done to CDN side and is rolling out gradually. It should be now fixed at least in 50% level of the world. Curious on test results.

VesaJuvonen avatar Aug 20 '19 17:08 VesaJuvonen