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

Babel-Jest doesn't support Babel 7 #6476

Closed
jrgleason opened this issue Jun 15, 2018 · 8 comments
Closed

Babel-Jest doesn't support Babel 7 #6476

jrgleason opened this issue Jun 15, 2018 · 8 comments

Comments

@jrgleason
Copy link

🐛 Feature

To Reproduce

npm install @babel/core babel-jest
./node_modules/.bin/jest

Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.

Expected behavior

I would like for this to be supported.

Link to repl or repo (highly encouraged)

Please provide either a repl.it demo or a minimal repository on GitHub.

Issues without a reproduction link are likely to stall.

Run npx envinfo --preset jest

Paste the results here:

$ ./node_modules/.bin/jestnpx envinfo --preset jest
-bash: ./node_modules/.bin/jestnpx: No such file or directory
$ npm install jestnpx
npm ERR! code E404
npm ERR! 404 Not Found: jestnpx@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /.../.npm/_logs/2018-06-15T20_00_03_861Z-debug.log
@anaisbetts
Copy link

We're seeing this too, here's the output of our envinfo:

npx envinfo --preset jest

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  Binaries:
    Node: 9.11.1
    Yarn: 1.5.1
    npm: 5.6.0
  npmPackages:
    jest:
      wanted: ^22.4.2
      installed: 22.4.3

@SimenB
Copy link
Member

SimenB commented Jun 18, 2018

It does work with babel 7, please read the docs: https://facebook.github.io/jest/docs/en/getting-started.html#using-babel

@SimenB SimenB closed this as completed Jun 18, 2018
@lloydjatkinson
Copy link

It doesn't work with Babel 7 following the docs.

npm install babel-core@^7.0.0-0 --save-dev
npm ERR! code ETARGET
npm ERR! notarget No matching version found for babel-core@7.0.0-0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

@chulander
Copy link

@lloydjatkinson, while this doesn't solve your problem, to install babel 7+ you have to include the @ prefix

npm i @babel/core@7.0.0-beta.51

@Nantris
Copy link

Nantris commented Jun 24, 2018

I have to agree with @lloydjatkinson.

I'm no stranger to babel configs, but this definitely does not work. I'm trying one final Hail Mary of clearing out all my node modules and cached versions, but my hopes are very low.

I'm using a babel.config.js file. Is this a potential problem? If this is not the cause, I have to conclude that the documentation for Babel 7 is insufficient or wrong.

@paulcbetts, were you able to get this working?

@SimenB
Copy link
Member

SimenB commented Jun 25, 2018

If you think there's an issue after following the docs, please open up a new issue with a clear reproduction (setting up a small repo would be the best, this issue provided no such thing). Just saying "doesn't work" gives us nothing to go on, since it does work (we use at at work). Seeing a misconfiguration might give us a good idea on how to improve the docs 🙂

@verekia
Copy link

verekia commented Jul 10, 2018

Here is the new issue with a minimal repo: #6662

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants