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
Attempted import error #10156
Comments
Hey @hawx1993! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
@hawx1993!: I have not been able to reproduce this. I've written a gist based on your report. When I build and run it, it does so without error: $ npm run build
$ NODE_ENV=development node public/bundle.js Can you modify this gist so that it reproduces your issue? You can clone it with |
@thiagoarrais thanks for comment. |
@thiagoarrais |
Babel doesn't do multi-file analysis (it's listed in the caveats list of the TS plugin), so it has no way to know that that export declaration should be removed. |
I'm getting this error in my React app as well with similar parameters as @hawx1993.
in my index.ts file:
The Account.tsx file in abridged version. Standard export default with Redux connect.
Expected behavior/code Part of the issue in my environment is that Jest I'm also using Typescript which might have something to do with it since @hawx1993's example uses TS as well. Other babel dependencies are listed below. Babel Configuration (.babelrc, package.json, cli command)
Environment
Node/npm version OS How you are using Babel |
Maybe related to #10162? Particularly to pixelass' comment? |
Yup 👍 Seems like we can close this issue since a fix seems to have been merged in with #10167 and it's a dupe of #10162. Just need to wait for the new release with the fix in place. For reciprocity, the issue is a TS specific issue where re-exported values don't get exported correctly. For example if you tried to import a file declared like this which imports and re-exports the same value, you will not end up getting any value imported into the file you tried to import in using babel v7.5.0 in its current state:
|
Update: This issue has been resolved by updating to react-hot-loader@^4.12.5 |
7.5.1 still has bug babel/babel#10156 (comment)
Yeah, this has been fixed in a patch version (I don't remember which one exactly, but <= 7.5.4) |
Bug Report
Current Behavior
in my index.ts file
Expected behavior/code
import correctly
Babel Configuration (.babelrc, package.json, cli command)
Environment
Node/npm version: [e.g. Node 10.9.2/npm 6.2.0]
OS: mac os
How you are using Babel: loader
The text was updated successfully, but these errors were encountered: