hapijs / boom

HTTP-friendly error objects
Other
2.94k stars 192 forks source link

@hapi/boom error #283

Closed xusai2014 closed 3 years ago

xusai2014 commented 3 years ago

Support plan

Context

What are you trying to achieve or the steps to reproduce?

Error is as below


/node_modules/@hapi/boom/lib/index.js:69
exports.Boom = class extends Error {
               ^
TypeError: Cannot assign to read only property 'Symbol(Symbol.hasInstance)' of function 'function Boom(message, options) {
        if (options === void 0) { options = {}; }
        var _this = this;
 ...<omitted>... }'
    at /node_modules/@hapi/boom/lib/index.js:92:32
    at Object.<anonymous> (/node_modules/@hapi/boom/lib/index.js:69:16)

What was the result you got?

What result did you expect?

Nargonath commented 3 years ago

The tests are successful on node@14 on our part for the latest version so my guess is that the problem comes from the way @hapi/boom is used. From your stacktrace it seems perhaps something is trying to assign to the static method Symbol.hasInstance on the Boom prototype after it has been defined. 🤔 Did you share the full stacktrace?

devinivy commented 3 years ago

Seems like this may have become an inactive issue. The only thing I have to add is that it sounds like you may be trying to bundle boom for the browser, which isn't officially supported by this module, which is designed for server-side usage. But if you're intent on doing it, then it may require configuring your bundler to treat boom as a nodejs module rather than something pre-built for the browser.