... satisfies both eslint as well as tsc, but bundled with webpack in nextJs 14, the browser throws the following error:
Uncaught TypeError: reified_client_api__WEBPACK_IMPORTED_MODULE_2__.Support.Common.Objects.currentUser.custom_field is not a function
Maybe some overzealous optimisation (tree shaking?) is removing the function from the compiled code. I'm aware that this may very well be a local configuration error - I'm using nextjs and am not an expert on all the webpack optimisations they have going on that may be involved with this. But I figured I'd mention this anyway, you may have a better idea if there is anything we can to do avoid this.
FWIW, as a workaround, the following has worked fine, but somewhat defeats the purpose of this library:
While trying to come up with an answer for @rajeshpatil-mset in https://github.com/Joshlha/reified-client-api/pull/5#issuecomment-2047696339, I noticed something curious:
This code:
... satisfies both eslint as well as tsc, but bundled with webpack in nextJs 14, the browser throws the following error:
Maybe some overzealous optimisation (tree shaking?) is removing the function from the compiled code. I'm aware that this may very well be a local configuration error - I'm using nextjs and am not an expert on all the webpack optimisations they have going on that may be involved with this. But I figured I'd mention this anyway, you may have a better idea if there is anything we can to do avoid this.
FWIW, as a workaround, the following has worked fine, but somewhat defeats the purpose of this library: