tsalb/lwc-utils

Datatable - broken as of Summer 21?

solo-1234 opened this issue · 9 comments

My org was upgraded to Summer 21 on Friday and it looks like SOQL Datatable is broken!

When I open a page with embedded datatables, the datatable doesn't show and I get two error popups:
[Cannot read property 'initializeTable' of null]
and
n.generateUUID is not a function

I tried running a flow with a SOQL Datatable and got
[Cannot read property 'initializeTable' of null]
And also a generic
This page has an error. You might just need to refresh it. First, would you give us some details?

Tried the flow in Debug and I don't get any errors, but the datatable doesn't show. (The rest of the screen does display.)

Tried a flow + CollectionDatatable and I get a different error:
https://i.imgur.com/AW9GzbG.png

And in debug there's no error message but the screen with the datatable never loads, instead it's stuck on on the 'loading' symbol.

I am on ver 1.6.0

tsalb commented

Unfortunately I am unable to reproduce on a fresh summer 21 scratch org using 1.6.0 AND the latest summer-21 branch that is yet to be released. A couple of thoughts here:

  1. Make sure your org doesn't have an lwc called utils as that is used in 1.6.0 in my lib. If you installed another appex or USF component that has utils LWC, you've just overwritten dependencies in this lib! This aligns to your error generateUUID is not a function error, since that function is in the 1.6.0 utils LWC file.

  2. Reinstall 1.6.0 to guarantee you have all dependencies in lwc-utils as the latest.

  3. Alternatively, I've released a hidden 1.6.1 and let you install a modified version of the summer-21 branch early. I'll refer to this issue on the latest release AND the wiki in the interim as I work on 1.7.0 (for real). 1.6.1 should address any "collision" related errors (likely what happened above). You must read and execute due diligence per the warning below.

IMPORTANT INSTALL NOTE

1.6.1 is an intermittent version between 1.7.0 meant to address any LWC file "collisions". It will not be under the official releases and is meant as a stop-gap for any orgs that have upgraded to summer 21 early or face this issue as described in this bug.

I have renamed some key components and prefixed a base to their name.

It is HIGHLY RECOMMENDED you read this next section.

  1. Ensure you are on the latest 1.6.0 and it is correctly installed.

  2. Upgrade to 1.6.1 with this url / packageId. You are responsible for figuring how best to install it, given the packageId below:

    <your_base_url>/packaging/installPackage.apexp?p0=04t1Q000001MRsJQAW
    
  3. The following components have been prefixed with base so make sure they have been migrated correctly in your org. I am not 100% familiar with how deprecation of unlocked 2GP (through renaming) works, so please ensure that the versions of these components without base prefix are removed from your org UNLESS they are a completely different component.

    Screen Shot 2021-06-06 at 11 28 50 AM
  4. Manual steps to deprecate renamed files will be required if you have included them as a dependency in other parts of your org. See the example below of utils which was renamed to baseUtils:

    Screen Shot 2021-06-06 at 11 49 18 AM
  5. For these components which were marked for deprecation but unable to be automagically deprecated please unwind any dependencies and either delete them through the menu OR deploy a destructiveXml to delete them all at once (again, after you've unwound any dependencies in your org that uses the deprecated components).

Thanks for responding. I upgraded to the latest version last night as part of my troubleshooting. My org shows one LWC called utils which was last modified at that time (last night) so I assume it's from lwc-utils.

Will attempt to install 1.6.1 in a sandbox and see how that goes.

Thanks!

Seems like the issue has gone away all by itself! Unable to replicate in my sandbox or prod as of now. Go figure...

tsalb commented

For posterity, we discussed on discord and it seems like this was order of operations:

  • Older version of lib (likely 1.5.4) started showing errors in summer 21 prod.
  • Upgrade to 1.6.0 and after first few page refreshes not fixed.
  • Wait some time (speculation: CDN or cache was holding onto old lib versions, of one or more files). Then, production started working on 1.6.0 after some time had elapsed.

Conclusion:

If summer 21 is causing issues then update to 1.6.0 first instead of 1.6.1.

Only upgrade to 1.6.1 if there is any kind of file name collision OR 1.6.0 doesn’t work in summer 21 prod after multiple hard cache refreshes / significant amount of time has lapsed (see speculation above).

Okay... so I just had this issue again, after I upgraded my installation of apex-rollup. It seems like that is what caused it in the first place (and the summer 21 upgrade was unrelated).

Was able to solve this by:
Reinstalling 1.6.0 (to make sure I had a working installation)
Upgrading to 1.6.1 (using the link above)
Checking that all lwcs listed in the screenshot exist (they did) and that none of them existed without the base prefix (they didn't, except for the culprit - utils )
Reinstalling apex-rollup

All is now working in sandbox. Stand by for production testing...

This should be resolved for good with the v1.2.28 release of apex-rollup

I followed those same steps in production and all seems to be working properly! Whew!

@tsalb Is there a link to where I can install 1.6.0 so that I can follow @solo-1234 's steps? I'm experiencing the same issue on a fresh install of 1.7.0 and trying to resolve the [Cannot read property 'initializeTable' of null] error message.

Interestingly - for myself, i get this error ONLY when editing the lightning page that the component is on, the actual datatable loads correctly for the viewer of the page.

tsalb commented

@RomanTheCube no install link, but you can peek into the sfdx-project.json to see the packageIds and then formulate your own install url.

That being said, if you already have 1.7.0 I dont know the implications or feasibility of installing 1.6.0 (downgrade). You should definitely uninstall all and then only install 1.7.0.

FYI - I am unable to replicate the issue in App Builder (Flexipage edit mode) on a fresh scratch org. I think this might be something unique to your org =(