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

Error launching JS inspector: _open(...).default.openApp is not a function #760

Open
DanilVelichko opened this issue May 10, 2023 · 7 comments

Comments

@DanilVelichko
Copy link

I've installed last version on my Windows 11 and after click on Open JS Debugger on Android emulator - the error on terminal in Visual Studio Code - Error launching JS inspector: _open(...).default.openApp is not a function. Help!

@Seagullie
Copy link

Had same issue and managed to figure out a workaround.

I modified the default export in node_modules\open\open-main.js to include .openApp():

module.exports = {
    openMain: function (target, opts) {
        if (process.env.REACT_DEBUGGER) {
            if (opts.app) {
                console.log("Debugger for React Native is configured. Skipping launch of " + opts.app);
            }
            return;
        }

        return open(target, opts);
    },
    openApp: open.openApp,
};

And now I can launch the debugger 🤔
I'm on Windows 10, btw

@DanilVelichko
Copy link
Author

Coool! It's working now!! Tnx a lot!

@AmrikTheProgrammer
Copy link

@Seagullie could you explain why this feature does not work straight out of the box when just installing expo?

@Nashit2401
Copy link

@Seagullie I tried the changes that you implemented but it is still giving the same error. I am on Windows 11 if that matters.

@gupta-karan1
Copy link

Had same issue and managed to figure out a workaround.

I modified the default export in node_modules\open\open-main.js to include .openApp():

module.exports = {
    openMain: function (target, opts) {
        if (process.env.REACT_DEBUGGER) {
            if (opts.app) {
                console.log("Debugger for React Native is configured. Skipping launch of " + opts.app);
            }
            return;
        }

        return open(target, opts);
    },
    openApp: open.openApp,
};

And now I can launch the debugger 🤔 I'm on Windows 10, btw

Yup, this works! I changed the open-main.js file and added the "jsEngine": "hermes", to the app.json file.

@aleksandarbos
Copy link

i've installed as a direct requirement via npm install open, for some reason applying that patch didn't work for me.

@pjsandwich
Copy link

I had this issue and editing the node module didn't work, but deleting node_modules and package.lock.json or yarn.lock abd then re-installing packages magically fixed this for me. I should say it worked for me, then stopped working, so it's not like I've never been able to get it to work like some people may be experiencing

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

7 participants