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

[Jest] ReferenceError with inlineRequire: true #5182

Closed
grabbou opened this issue Jan 7, 2016 · 5 comments
Closed

[Jest] ReferenceError with inlineRequire: true #5182

grabbou opened this issue Jan 7, 2016 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@grabbou
Copy link
Contributor

grabbou commented Jan 7, 2016

Possibly related to #3999 @cpojer comments.

After upgrading from 0.14.2 to 0.17 and using react-native preprocessor.js - with default value set to true:

ReferenceError: /src/auth/newPasswordForm.js: _immutable is not defined
        at Object.<anonymous> (src/auth/newPasswordForm.js:3:30)

that:

import {Map} from 'immutable'

is simply striped out from transformed code (the first line in the file). Setting it to false makes tests green again.

Funny fact is that it's only affected by the jest. When running normally with packager - all goes smoothly.

@facebook-github-bot
Copy link
Contributor

Hey grabbou, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

@wvengen
Copy link
Contributor

wvengen commented Jan 21, 2016

I'm having a similar issue, replacing import ... from ... with require() works around the error. Perhaps somehow Babel is not setup correctly while testing?

@ColCh
Copy link
Contributor

ColCh commented Feb 22, 2016

Same, for jest 0.9.0-fb2 and react-native 0.19.
Probably, using require or setting inlineRequires: false gets work done, but any update on this issue?

UPD: same for RN 0.21.0-rc and 0.20.0 as well...

@cpojer
Copy link
Contributor

cpojer commented Mar 31, 2016

btw. I'll be recommending to use babel-jest together with babel-preset-react-native but I haven't had enough time to rewrite the documentation for this yet, unfortunately.

@cpojer
Copy link
Contributor

cpojer commented Jul 27, 2016

Thank you for your patience. We launched Jest 14.0 with experimental react-native support:

Please feel free to create new issues after trying out the new integration if any issues remain.

@cpojer cpojer closed this as completed Jul 27, 2016
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants