Problems debugging the browser mode with playwright #6622
Replies: 3 comments 4 replies
-
Do you import from playwright directly in your browser tests? Why is it in your |
Beta Was this translation helpful? Give feedback.
-
I checked here and the error happens in this function var require_playwright_core = __commonJS({
"node_modules/playwright-core/index.js"(exports, module) {
var minimumMajorNodeVersion = 14;
var currentNodeVersion = process.versions.node;
var semver = currentNodeVersion.split(".");
var [major] = [+semver[0]];
if (major < minimumMajorNodeVersion) {
console.error(
"You are running Node.js " + currentNodeVersion + `.
Playwright requires Node.js ${minimumMajorNodeVersion} or higher.
Please update your version of Node.js.`
);
process.exit(1);
}
module.exports = require_inprocess();
}
}); My code is in Javacript Vanilla, I am not using any node environment, so I don't think I have a process.versions. Can it be something related to that? Do you know what can I verify next? |
Beta Was this translation helpful? Give feedback.
-
The problem is that I forgot to remove an import in the begging of the file. I had an import |
Beta Was this translation helpful? Give feedback.
-
I have a custom HTML Element that in the connectedCallback() function get some data to render the component. The function "getData()" first checks the local storage for the data, if the data is there it set the "data" attribute and the component is rendered. On the other case, the component does a rest request to an API.
My custom class:
In this project I am using browser mode with playwright as provider.
I wrote a test that sets the local storage key and checks after rendering the component if the "dataMap" attribute is the same set.
My Test:
But this test is failing saying:
I think this is related with
expect(customDataElement.dataMap).toEqual(expectedDataMap);
but the error is very genericI tried following the browser mode debugging
But a error happens:
launch.json:
"vitest": "^2.0.5"
"playwright": "^1.47.0"
"vite": "^5.3.4"
"@vitest/browser": "^2.0.5"
Beta Was this translation helpful? Give feedback.
All reactions