Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nolanlawson opened this issue Jan 8, 2024 · 3 comments · Fixed by #4041
Labels
BUG P3 enhancement Up for grabs Issues that are relatively small, self-contained, and ready for implementation

Comments

@nolanlawson
Copy link
Contributor

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: #3904

@nolanlawson nolanlawson added this to the 6.0.0 milestone Jan 8, 2024
@nolanlawson nolanlawson added Up for grabs Issues that are relatively small, self-contained, and ready for implementation BUG P3 labels Jan 24, 2024
Copy link

git2gus bot commented Jan 29, 2024

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

@nolanlawson nolanlawson removed this from the 6.0.0 milestone Jan 29, 2024
@nolanlawson nolanlawson added BUG P3 and removed BUG P3 labels Jan 29, 2024
Copy link

git2gus bot commented Jan 29, 2024

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

@jmsjtu
Copy link
Member

jmsjtu commented Mar 7, 2024

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.

nolanlawson added a commit that referenced this issue Mar 8, 2024
nolanlawson added a commit that referenced this issue Mar 8, 2024
ravijayaramappa added a commit that referenced this issue Mar 12, 2024
* refactor: organize API versioning tests (#4040)

* fix: disable form association entirely on older API versions (#4041)

Fixes #3929

* Revert "fix(synthetic-shadow): retargeting does not correctly account for nat…" (#4047)

This reverts commit 13cd45f.

* chore: routine dependencies update (#4046)

* chore: routine dependencies update

* fix: revert prettier updates

* chore: update husky

* chore: update husky

* fix: disable ts rule

* chore: v6.3.2 (#4048)

---------

Co-authored-by: Nolan Lawson <[email protected]>
Co-authored-by: Eugene Kashida <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG P3 enhancement Up for grabs Issues that are relatively small, self-contained, and ready for implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants