Skip to content

Commit

Permalink
fix: set proper environment for remote debugging (#279)
Browse files Browse the repository at this point in the history
* fix: some RN libraries relies on that the environment is not strict

close #278

* docs: added comment

* Update debuggerWorker.js
  • Loading branch information
jukben authored and satya164 committed Nov 9, 2017
1 parent 00d6cd0 commit 5a26baf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/server/assets/debuggerWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@

/* eslint-disable */

'use strict';
/**
* IMPORTANT: Do not add "use strict"
* https://github.com/callstack/haul/issues/278
*
* Some libraries like react-native-safe-module try to patch native modules to mock them
* and prevent crashes, but don't account for the case when `requireNativeComponent` returns
* a string. In strict mode, trying to modify properties of the string primitive throws an
* error - "Cannot create property...". This breaks some modules like Lottie which use
* react-native-safe-module
*/

onmessage = (function() {
let visibilityState;
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4401,7 +4401,7 @@ sax@^1.2.1:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"

"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1:
"semver@2 || 3 || 4 || 5", semver@^5.3.0:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"

Expand Down

0 comments on commit 5a26baf

Please sign in to comment.