babel-plugin-redux-saga cannot read property start of undefined
See original GitHub issueDescription of the bug/issue
Hi,
I just updated to version 1.0.0
from 1.0.0-rc-0
.
Everything is working good until I added the babel-plugin
then I’m getting exception:
TypeError: Cannot read property 'start' of undefined
here is the stactrace:
TypeError: Cannot read property 'start' of undefined
at calcLocation (/Users/project/node_modules/babel-plugin-redux-saga/src/index.js:57:26)
at PluginPass.FunctionExpression (/Users/project/node_modules/babel-plugin-redux-saga/src/index.js:116:26)
at newFn (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js:193:21)
at NodePath._call (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:118:16)
at TraversalContext.visitMultiple (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:85:17)
at TraversalContext.visit (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:144:19)
at Function.traverse.node (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js:94:17)
at NodePath.visit (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:95:18)
at TraversalContext.visitQueue (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:118:16)
at TraversalContext.visitSingle (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:90:19)
at TraversalContext.visit (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:146:19)
at Function.traverse.node (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js:94:17)
at NodePath.visit (/Users/project/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:95:18)
Steps to reproduce the bug/issue
for me it was just to add the babel-plugin-redux-saga
.
removing it just works.
here is my babel file:
module.exports = {
presets: [
['@babel/env', { modules: false }],
'@babel/react',
],
plugins: [
'babel-plugin-redux-saga',
'@babel/syntax-dynamic-import',
'@babel/plugin-proposal-export-namespace-from',
'babel-plugin-styled-components',
'react-hot-loader/babel',
'@babel/plugin-proposal-class-properties',
['transform-imports', {
ramda: {
transform: importName => `ramda/es/${importName}`,
preventFullImport: true,
},
}],
],
env: {
test: {
presets: [
['@babel/env'],
'@babel/react',
],
plugins: [
'babel-plugin-styled-components',
],
},
},
};
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
"Cannot read property 'use' of undefined". after upgrade to ...
I had to update to react-script: 4.0.1 due to an error when wanting to migrate part of my project to typeScript. update customize-cra...
Read more >When using redux-saga with react-native ... - Stack Overflow
This seems to be an issue due to babel-preset-react-native 2.1.0. Simply downgrade to 2.0.0 and it should work fine:
Read more >Troubleshooting | Redux-Saga
So staring with redux-saga@v1 , when error bubbles to root saga, the library builds that "saga stack" and passes it as a property...
Read more >typeerror: cannot read property 'location' of undefined jest
I found that I can mock the React Router hooks like useLocation using the following ... TypeError: Cannot read property 'open' of undefined...
Read more >babel-plugin-redux-saga - npm
Start using babel-plugin-redux-saga in your project by running `npm i babel-plugin-redux-saga`. There is 1 other project in the npm registry ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
should fix https://github.com/redux-saga/redux-saga/pull/1745
@Andarist Hi again I found the issue, This happens when you have some class function with the
async
prefix.To reproduce it just clone this repo. add the
babel-plugin-redux-saga
Then underapp/containers/HomePage/HomePage.js
addasync
to thecomponentDidMount
function, and you will see the error