这是indexloc提供的服务,不要输入任何密码
Skip to content

TypeError: Cannot set property ResponsiveMasonry of #<Object> which has only a getter in npm package #156

@dicaxyz

Description

@dicaxyz

In lib folder of npm package,
This line in index.js:
Object.defineProperty(exports, "ResponsiveMasonry", {
enumerable: true,
get: function get() {
return _ResponsiveMasonry["default"];
}
});

creates an accessor property on exports for ResponsiveMasonry. That means it's defined with a getter only, not a writable value.
Then later, this line appears:
exports.ResponsiveMasonry = _ResponsiveMasonry["default"];

This attempts to assign to exports.ResponsiveMasonry, which throws a TypeError in strict mode because the property is not writable.

The fix is pretty easy. ResponsiveMasonry does not need to expose twice, just remove one of the expose. I understand this code was generated by the compiler. Could you please take a look please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions