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

try-puppeteer: (async() => { ... })() fails silently #9

Open
ebidel opened this issue Nov 2, 2017 · 2 comments
Open

try-puppeteer: (async() => { ... })() fails silently #9

ebidel opened this issue Nov 2, 2017 · 2 comments

Comments

@ebidel
Copy link
Owner

ebidel commented Nov 2, 2017

From @ithinkihaveacat on November 2, 2017 12:33

The following code (abbreviated version of a file from the examples folder) fails silently when entered in the editing component at https://try-puppeteer.appspot.com/:

(async() => {
const browser = await puppeteer.launch();
console.log('Hello, World');
})();

Actual:

No output, no error message.

Expected:

The output Hello, World!.

Copied from original issue: puppeteer/puppeteer#1254

@ebidel
Copy link
Owner Author

ebidel commented Nov 2, 2017

Ironically, this by itself works:

(async() => {
console.log('Hello, World');
})();

I think we can get around it by adding an await in front of the user code (https://github.com/ebidel/try-puppeteer/blob/master/backend/server.js#L85) just in case someone uses an async IIFE wrapper.

@ebidel
Copy link
Owner Author

ebidel commented Nov 2, 2017

Unfortunately, that won't work if the user just has:

const browser = await puppeteer.launch();
...

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

1 participant