lwc icon indicating copy to clipboard operation
lwc copied to clipboard

[Post LWC v6] Add friendly error message when ElementInternals is not available due to lower API version

Open nolanlawson opened this issue 1 year ago • 2 comments

To use ElementInternals, you'll need to be on the latest API version. We should have a friendly error message like "You cannot use static formAssociated or attachInternals because your apiVersion is X and it should be at least Y."

Related: https://github.com/salesforce/lwc/pull/3904

nolanlawson avatar Jan 08 '24 19:01 nolanlawson

Error while creating work item. No valid build found in GUS!

git2gus[bot] avatar Jan 29 '24 18:01 git2gus[bot]

This issue has been linked to a new work item: W-14915388

git2gus[bot] avatar Jan 29 '24 20:01 git2gus[bot]

Based on @nolanlawson's comment, we should consider defaulting the formAssociated value to false if useNativeLifecycle is also false.

We should also log a dev warning to let the component author know the issue.

One thing to note is that we apply formAssociated on-demand now and the first component to register with the tag name will determine the value.

If it's possible to switch the useNativeLifecycle flag at runtime, we may end up in a situation where the formAssociated value is true on the class but still registers as false on the host element.

This might not be a real issue but we might want to do some testing to verify.

jmsjtu avatar Mar 07 '24 19:03 jmsjtu