Skip to content

fix: detect node on react-native environments#87

Closed
simon-scherzinger wants to merge 1 commit into
JSONPath-Plus:masterfrom
entrecode:master
Closed

fix: detect node on react-native environments#87
simon-scherzinger wants to merge 1 commit into
JSONPath-Plus:masterfrom
entrecode:master

Conversation

@simon-scherzinger
Copy link
Copy Markdown

@simon-scherzinger simon-scherzinger commented Sep 12, 2018

This PR will fix JSONPath plus for react-native.

Currently it will fail since vm is not available in react-native. When bundling JavaScript for react-native it will try to find vm without success (see change in package.json).

During runtime it will fail since detecting of node will also be true in react-native (see change in lib/jsonpath.js)

Take care,

Simon

Comment thread package.json
},
"react-native": {
"vm": false
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If React-Native doesn't support vm anyhow, what does this do?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will tell reacts module bundling not to look for the vm module. Even though the module will not be used during runtime the bundler is still trying to find it.

@brettz9 brettz9 added the Bug label Oct 19, 2018
@brettz9
Copy link
Copy Markdown
Collaborator

brettz9 commented Oct 20, 2018

I think I sometimes fail to get notifications for code comments, so just a ping to let you know I made a comment and would be happy to pull this if you could answer the question.

@brettz9 brettz9 closed this in a52dd41 Oct 20, 2018
@brettz9
Copy link
Copy Markdown
Collaborator

brettz9 commented Oct 20, 2018

Incorporated into master and released in version v0.18.0...thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants