Context:
Code Snippet
const {chromium} = require('playwright');
(async () => {
const browser = await chromium.launch();
// ...
})();
Describe the bug
When running the above simple example, I get this error:
Error: Unsupported platform for webkit: mac10.13
at Object.assert (/Users/tim/code/example/node_modules/playwright-core/lib/helper.js:288:15)
at Object.executablePath (/Users/tim/code/example/node_modules/playwright-core/lib/server/browserFetcher.js:130:14)
at downloadOptionsFromENV (/Users/tim/code/example/node_modules/playwright-core/download-browser.js:45:36)
at Object.<anonymous> (/Users/tim/code/example/node_modules/playwright/index.js:25:37)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
As in my understanding, https://github.com/microsoft/playwright/pull/1549 should have fixed this, I guess it's unintended behavior, therefore a bug.
Just to clarify, does this mean that we can't use Playwright on mac 10.13 even if not using Webkit?
If you're using Chromium and/or Firefox, macOS 10.13 will work. Are you having any issues with that?
So we have a tool built on top of playwright to run visual regression tests. The tool handles all three browsers but the browsers that are going to be used at runtime for tests can be defined by flags when starting the tool.
People trying to run our tool on 10.13 with only Chrome still get the above error
Ah, this happens due to Playwright early initialization. Should not be hard to fix.
Thanks for looking into it!
Note, that no matter, if I try to launch firefox, webkit or chrome, all of them error with the same error:
Unsupported platform for webkit: mac10.13
So Chromium and Firefox do not work as of now.
Just confirmed it with the latest next build 0.15.0-next.1588118874017.
@timsuchanek can you please check v0.17.0 that we just released? It should've fixed this issue.
Thanks @aslushnikov! I just tried it out - chromium and firefox work now.
webkit errors like this:
UnhandledPromiseRejectionWarning: Error: Browser is not supported on current platform
at WebKit.executablePath (/Users/tim/code/repros/playwright/node_modules/playwright-core/lib/server/browserType.js:28:19)
at WebKit._launchServer (/Users/tim/code/repros/playwright/node_modules/playwright-core/lib/server/webkit.js:77:57)
at async WebKit.launch (/Users/tim/code/repros/playwright/node_modules/playwright-core/lib/server/webkit.js:41:69)
To sum up this:
trying with macos 10.13.6 (17G2208), no matter what i get the error "Browser is not supported on current platform"
const { firefox, devices } = require('playwright');
const iPhone11 = devices['iPhone 11 Pro'];
(async () => {
const browser = await firefox.launch();
const context = await browser.newContext({
...iPhone11,
locale: 'en-US',
geolocation: { longitude: 12.492507, latitude: 41.889938 },
permissions: ['geolocation']
});
const page = await context.newPage();
await page.goto('https://google.com');
await browser.close();
})();
@Pezhvak, v1.4.2 was just released with the fix
Most helpful comment
@Pezhvak, v1.4.2 was just released with the fix