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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unknown option: .cacheDirectory" after updating to babel-jest v24.3.0 #8082

Closed
edmorley opened this issue Mar 8, 2019 · 3 comments
Closed

Comments

@edmorley
Copy link
Contributor

edmorley commented Mar 8, 2019

馃挜 Regression Report

After updating to the v24.3.0 minor release, our tests started failing with:

ReferenceError: Unknown option: .cacheDirectory.
Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.

This appears to be due to the change here (CC @SimenB):
https://github.com/facebook/jest/pull/7862/files#diff-ad0be0b5e1f4711c408a42bdbea512bcL42

The reason cacheDirectory was present is that we were passing the Babel config used for babel-loader as-is:
https://github.com/neutrinojs/neutrino/blob/97781fd69dbf01be33a07687670a064395a92a6b/packages/jest/src/index.js#L21-L25
https://github.com/neutrinojs/neutrino/blob/97781fd69dbf01be33a07687670a064395a92a6b/packages/jest/src/transformer.js

In the meantime we've added filtering of cacheDirectory (neutrinojs/neutrino/pull/1314).

Last working version

Worked up to version: v24.1.0

Stopped working in version: v24.3.0

To Reproduce

Trigger a Travis build on https://github.com/neutrinojs/neutrino revision 97781fd69dbf01be33a07687670a064395a92a6b (which is before neutrinojs/neutrino/pull/1314).

Expected behavior

That either:

  • the Babel options sanitisation not change in a minor version
  • (or if this is seen as an internal implementation detail that we shouldn't have been replying upon) for the Jest changelog to perhaps mention the change

Many thanks :-)

@SimenB
Copy link
Member

SimenB commented Mar 8, 2019

Aha, that's where it was from! The typings yelled at us and I couldn't find cacheDirectory by grepping in Babel's code base, so I just removed it.

Wanna send a PR adding it back? Even though I don't think it's Jest's job to filter out non-valid options to babel, it doesn't hurt. And we shouldn't stop doing it in a minor

@SimenB
Copy link
Member

SimenB commented Mar 8, 2019

Can probably just add it with @ts-ignore and an explanation it's to work with config to babel-loader, similar to #7862 (comment)

@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 Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants