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

Cannot read property 'BLOB_URI_SCHEME' of undefined after upgrade to RN48 #4433

Closed
rknell opened this issue Sep 6, 2017 · 7 comments
Closed

Comments

@rknell
Copy link

rknell commented Sep 6, 2017

  • Jest v21.0.1
  • I have removed and reinstalled the node_modules folder
  • I have run jest --no-cache

Node version: 7.8.0

Also used NVM to upgrade to Node v8.4.0, fresh yarn global install, deleted node modules and reinstalled, error still exists.

{
	"name": "rnJestBugRepl",
	"version": "0.0.1",
	"private": true,
	"scripts": {
		"start": "node node_modules/react-native/local-cli/cli.js start",
		"test": "jest"
	},
	"dependencies": {
		"react": "16.0.0-alpha.12",
		"react-native": "0.48.1"
	},
	"devDependencies": {
		"babel-jest": "21.0.0",
		"babel-preset-react-native": "3.0.2",
		"jest": "21.0.1",
		"react-test-renderer": "16.0.0-alpha.12"
	},
	"jest": {
		"preset": "react-native"
	}
}

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Fresh project, RN0.48.1 fails with error running yarn test. I noticed the error appear on an existing project after upgrading to RN0.48.1 on every test.

TypeError: Cannot read property 'BLOB_URI_SCHEME' of undefined
      
      at Object.<anonymous> (node_modules/react-native/Libraries/Blob/URL.js:21:21)
      at node_modules/react-native/Libraries/Core/InitializeCore.js:174:40
      at getValue (node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js:44:10)
      at ContextifyScript.Script.runInContext (vm.js:32:29)

Commenting out the blob requirement in the node_modules/react-native/Libraries/Blob/URL.js:21:21 file allows the app to continue to pass all tests. The app runs without errors with no source code modification.

I have a copy of my code here: https://github.com/rknell/rn0481JestBugReproduction

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

What is the expected behavior?

Tests continue to run as normal

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

Please see repo for config, further details below

Npm (on node 8 5.3.0)
Yarn 0.27.5

@cpojer
Copy link
Member

cpojer commented Sep 6, 2017

This seems like a change needs to be made in react-native, not in Jest.

@cpojer cpojer closed this as completed Sep 6, 2017
@thymikee
Copy link
Collaborator

thymikee commented Sep 6, 2017

Yup, this is bug in react native, fixed in master while updating flow version so its not yet in the release channel.

@rknell
Copy link
Author

rknell commented Sep 6, 2017 via email

@rknell
Copy link
Author

rknell commented Sep 6, 2017 via email

@rknell
Copy link
Author

rknell commented Sep 6, 2017

To anyone coming across this, facebook/react-native#15810 is the relevant issue, and you can avoid the issue for now by rolling back to node v7.4.0

@SaraChicaD
Copy link

Thanks for that @rknell ! Fixed my issue, appreciate you!

@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 13, 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

4 participants