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

Debug screen was locked about 3minutes #7

Open
taipa-ibl opened this issue Jun 18, 2017 · 5 comments
Open

Debug screen was locked about 3minutes #7

taipa-ibl opened this issue Jun 18, 2017 · 5 comments

Comments

@taipa-ibl
Copy link

Hi,

I set to run Crypto on React-Native 0.45.1.
It is able to run, but have a trouble.
That is when debug app, it is always freeze the chrome debug tab for about 3 minutes, after that, it run as normal.

Did you get a problem like this ?

@brandonfancher
Copy link

This seems to be happening to me too.

@brandonfancher
Copy link

@taipa-ibl, I think I found the culprit.

In my babel-transformer.js file, I had:

const babelRC = {
	presets: ['react-native'],
	sourceMaps: true,
	plugins: [
...

Once I commented out the sourceMaps: true, line, Chrome Debugger stopped locking up on load and refresh.

Let me know if that fixes it for you.

@brandonfancher
Copy link

brandonfancher commented Jul 29, 2017

@taipa-ibl: After more investigation, I got source maps working with fast Chrome Debugging and better rebuild times. The solution? Move all of my transform code to .babelrc. I deleted my other transform files entirely. (I'm also depending on a different babel transform plugin, but I believe that's unrelated.) Here's what I have in my .babelrc:

{
  "presets": ["react-native"],
  "sourceMaps": true,
  "plugins": [
    ["module-resolver", {
      "alias": {
        "crypto": "react-native-crypto",
        "stream": "stream-browserify",
        "vm": "vm-browserify",
      },
    }],
  ],
  "env": {
    "development": {
      "plugins": ["transform-react-jsx-source"]
    }
  }
}

I'm fairly new to this babel transform stuff, so if you see anything in there that's incorrect or could be improved, I'm all ears. Hopefully this helps, though!

Of course, you may need more aliases in there. Depends on what all you're using.

@taipa-ibl
Copy link
Author

taipa-ibl commented Jul 31, 2017

@brandonfancher

Thank you very much. It's work !!!
You save my life.

@agrcrobles
Copy link

@brandonfancher thanks! it really helped me too!
I ended up implementing it your way along with a tiny implementation of randombytes to be compatible with JavascriptCore and I could use crypto-browserify instead.

https://github.com/agrcrobles/babel-preset-react-native-web3/blob/master/src/index.js

I only needed crypto though, it brokes debugging and doesn't hot reload on expo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants