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

Never call callback on Mac os #91

Closed
Lilipi opened this issue Apr 4, 2018 · 9 comments
Closed

Never call callback on Mac os #91

Lilipi opened this issue Apr 4, 2018 · 9 comments

Comments

@Lilipi
Copy link

Lilipi commented Apr 4, 2018

Hello,

I've got a problem on Mac OS. Here is my code :

...
.then(function() {
    var opn = require('opn');
    return opn(url);
})
.then(function() {
         MessageService.success("Document ouvert");
         return;
     });

It works fine on Windows, but on Mac OS, the callback (messageService.success ...) is never called.

Can anyone help me ?

Thanks

@ptrcnull
Copy link

Probably related to #92.

@znevrly
Copy link

znevrly commented Jul 9, 2018

Hi, please any update?

@DanielRuf
Copy link

Still the same. On Windows my CLI app exits after I call opn, on macOS it waits and does not exit / return.

@DanielRuf
Copy link

Looks like the -W flag never fires an exit code unless we close the opened browser / app.

@DanielRuf
Copy link

Try opn(target, {wait: false}).

@sindresorhus
Copy link
Owner

sindresorhus commented Aug 7, 2018

From the docs:

Wait for the opened app to exit before fulfilling the promise.

@sindresorhus
Copy link
Owner

In hindsight, it would probably have been better to make the wait option false by default.

@DanielRuf
Copy link

In hindsight, it would probably have been better to make the wait option false by default.

True, this came to my mind last night but that would be too late now as the opposite is the default now.

@DanielRuf
Copy link

The assumption in general is to have the same behavior on all platforms (which is not the case as for Windows we have to manually set some application name) and to be consistent by default (without any further configuration).

And I think this is the reason why I and others tripped over this.

And you are right, we should have read the docs and check the default values.

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

5 participants