redux-saga/redux-saga

babel-plugin-redux-saga crashes sagas - Object.defineProperty called on non-object

Closed

#2,088 opened on Jun 27, 2020

 (1 comment) (0 reactions) (0 assignees)JavaScript (1,987 forks)batch import
bughelp wanted

Repository metrics

Stars
 (22,505 stars)
PR merge metrics
 (PR metrics pending)

Description

Steps to reproduce

yield something that isn't an object.

Description of the bug/issue

The plugin should check that that it transforming an object before calling defineProperty.

TypeError: Object.defineProperty called on non-object

Example

// I know there is nothing to yield here, but this would normaly be fine without the plugin 
function* foo() {
  yield 20; //  crash: Object.defineProperty called on non-object
}

Contributor guide