-
Notifications
You must be signed in to change notification settings - Fork 393
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
Remove errors that only occur in dev mode #3245
Comments
This issue has been linked to a new work item: W-12257612 |
This is a really sneaky one that I haven't gotten around to fixing yet: lwc/packages/@lwc/engine-core/src/framework/decorators/api.ts Lines 87 to 93 in d004e93
|
Might have to save this one ^ for when we have API versioning. Turns out it throws an error in dev mode, but not prod mode, and only when the accessor is accessed internally: 893d693 Feels like it should just consistently throw in both prod and dev mode when the |
A big problem is this function. It throws an error in dev mode, but not in prod mode: lwc/packages/@lwc/engine-core/src/framework/vm.ts Lines 480 to 488 in f689896
This function is called in many places. |
Synthetic shadow has a few of these, like this one: lwc/packages/@lwc/synthetic-shadow/src/faux-shadow/traverse.ts Lines 136 to 149 in 3a7e1b4
|
This is largely fixed, I'm going to call this one done for now. If something else comes up, we can open another issue. |
#3244 revealed a lot of cases where our functionality differs between dev mode and prod mode. Sometimes this makes sense (e.g. calling
console.warn
only in dev mode), but in other cases it can introduce surprising behavior, when you test in dev mode and then get a different result in prod mode.We should audit each of these cases and (probably) defer to doing the same thing in dev mode as prod mode. (In practice, prod mode is reality – many people never test in dev mode.)
Cases to check (in Karma test code):
if (process.env.NODE_ENV === ...)
expect(...).toThrowErrorDev()
expect(...).toThrowConnectedErrorDev()
The text was updated successfully, but these errors were encountered: