node-server icon indicating copy to clipboard operation
node-server copied to clipboard

Issue with RequestError having static name property

Open GavinMeierSonos opened this issue 9 months ago • 1 comments

Hard to say if this is a rollup issue or if this is a valid concern but the fix would be easy to implement.

When transpiling into esm. There is an issue with name being defined as a static value on the RequestError instead of just having it defined in the in the constructor. It throws an error saying that read only property name cannot be reassigned.

Happy to open a PR if this would be approved since it wouldn't impact any existing functionality and it does seem odd to define a static field on a class that is defined on the prototype. The fix would be to move the name assignment to the constructor after the super is called.

GavinMeierSonos avatar May 14 '24 20:05 GavinMeierSonos