-
Notifications
You must be signed in to change notification settings - Fork 35
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 when using --withoutjavascript
and a hash in url
#309
Comments
Note-to-self; The
Essentially, using If you omit Either way, I put some print logs about which URLs it's sending to
Here's it's having a problem with But if you omit, it's the exact same line ( I wonder, does |
Interesting comment here: puppeteer/puppeteer#2479 (comment) |
Even more interesting: puppeteer/puppeteer#2479 (comment) What @aslushnikov is suggesting is that the second page goto should be a new fresh page. What minimalcss does is something like this: // NOTE for this pseudo code demonstration I stripped out the try{}catch{} stuff
urls.forEach(url) {
const page = await browser.newPage();
await processPage({
page,
options, // <-- in here it has instructions to tell processPage()
url, // to do the page.goto() 2 times.
...
});
} What I think needs to happen is something like this: urls.forEach(url) {
const perUrlOptions = Object.assign({}, options)
let page
if (perUrloptions.withoutjavascript) {
page = await browser.newPage();
await processPage({
page,
perUrloptions,
url,
...
});
delete perUrloptions.withoutjavascript;
}
page = await browser.newPage();
await processPage({
page,
perUrloptions,
url,
...
});
} @artemf Would you mind attempting a patch like that and see if it works? |
Thanks for the research @peterbe! I will try the suggested fix soon. |
@artemf ping! Had a chance to look at a PR? |
Any update on this issue? |
Sadly no. Not me. Is this error happening to you? If so, do you think you can attempt a rough version of the above mentioned potential solution and see if it works? |
I have a problem when using the urls with a hash (as an angular route) and
--withoutjavascript
command line param. In this scenario minimalcss always fails withCannot read property 'ok' of null
error.My app might be too complicated for a quick demo, but here's the simplified case that demonstrates the problem:
It's not just google:
Seems like the no-js run with a hash in url fails.
Would appreciate any help / guidance of what might be happening and why it's failing!
The text was updated successfully, but these errors were encountered: