You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, using @wire on a getter or a setter successfully compiles, but it fails at runtime with "Error: [LWC error]: Invalid @wire dataProp field. Found a duplicate accessor with the same name." To prevent deploying faulty code, this error should be caught at compile time.
Currently, using @wire on a getter or a setter works, but it logs a misleading error at runtime, "Error: [LWC error]: Invalid @wire dataProp field. Found a duplicate accessor with the same name." This error should not be logged.
The text was updated successfully, but these errors were encountered:
In all three cases, the wire works as expected but an error is logged:
Invalid @wire value field. Found a duplicate accessor with the same name.
Since this is behavior we support (and I don't see any reason not to support it – a getter/setter is roughly the same as a class property), I would propose we don't remove it and instead get rid of the error-logging.
Based on the tests for the error message BTW, it looks like the intention was to prevent truly egregious mistakes like this one:
wjhsf
changed the title
Throw compiler error when using @wire on a getter or a setter
Remove misleading warning when using @wire on a getter or a setter
Aug 5, 2024
Currently, using@wire
on a getter or a setter successfully compiles, but it fails at runtime with "Error: [LWC error]: Invalid@wire
dataProp field. Found a duplicate accessor with the same name." To prevent deploying faulty code, this error should be caught at compile time.Currently, using
@wire
on a getter or a setter works, but it logs a misleading error at runtime, "Error: [LWC error]: Invalid@wire
dataProp field. Found a duplicate accessor with the same name." This error should not be logged.The text was updated successfully, but these errors were encountered: