Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error react-refresh/babel 0.4.0 #16686

Closed
natew opened this issue Sep 6, 2019 · 1 comment · Fixed by #16687
Closed

Compile error react-refresh/babel 0.4.0 #16686

natew opened this issue Sep 6, 2019 · 1 comment · Fixed by #16687

Comments

@natew
Copy link

natew commented Sep 6, 2019

Using react-refresh/babel 0.4.0 is giving me this error on a large number of files:

ERROR in ../orbit-app/src/hooks/useStores.ts
Module build failed (from ../node_modules/babel-loader/lib/index.js):
TypeError: Cannot read property '0' of undefined
    at Function.get (/Users/nw/projects/motion/orbit/node_modules/@babel/traverse/lib/path/index.js:115:33)
    at NodePath.unshiftContainer (/Users/nw/projects/motion/orbit/node_modules/@babel/traverse/lib/path/modification.js:191:31)
    at PluginPass.exit (/Users/nw/projects/motion/orbit/node_modules/react-refresh/cjs/react-refresh-babel.development.js:546:28)

I narrowed down that file to the simplest thing that causes it:

import { useContext } from 'react'

export default () => useContext()

Originally posted by @natew in #16604 (comment)

@gaearon
Copy link
Collaborator

gaearon commented Sep 6, 2019

Fixed in 0.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants