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

[REGRESSION]: TypeError [ERR_INVALID_ARG_TYPE] when running playwrite with node 20.6.1 #29253

Closed
PatrickG opened this issue Jan 31, 2024 · 9 comments

Comments

@PatrickG
Copy link

PatrickG commented Jan 31, 2024

Context:

  • GOOD Playwright Version: 1.30.0
  • BAD Playwright Version: 1.41.0
  • Operating System: Linux
  • Node version: 20.6.1

Describe the bug
I'm getting this error when trying to run the tests in https://github.com/sveltejs/kit

TypeError [ERR_INVALID_ARG_TYPE]: The "parentURL" argument must be of type string or an instance of URL. Received an instance of Object
    at new NodeError (node:internal/errors:405:5)
    at throwIfInvalidParentURL (node:internal/modules/esm/resolve:937:11)
    at Hooks.resolve (node:internal/modules/esm/hooks:241:5)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:337:35)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:220:38)
    at ModuleLoader.import (node:internal/modules/esm/loader:307:34)
    at Hooks.register (node:internal/modules/esm/hooks:138:51)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

I guess the changes in #28526 are the source of this bug.

It works when upgrading to Node 21.6.1.

@mxschmitt
Copy link
Member

mxschmitt commented Jan 31, 2024

Looks like this was about a Node.js bug which was fixed in a recent 20.x release, e.g. v20.11.0 (latest 20.x).

I was able to reproduce in v20.6.1 but not in v20.11.0.

Closing since we only support the latest minor/patch releases of Node.js versions.

@RF2023
Copy link

RF2023 commented Apr 23, 2024

v20.11.0.

Facing this issue with v20.10.0, anything we are missing?

@furqan-qadri
Copy link

furqan-qadri commented May 26, 2024

works for me with node v 20.9

you can install this node version and then use command nvm use
also put this in the .nvmrc file. like so: v20.9

this works for me but only within the current shell

@ChristiansGithubID
Copy link

I'm getting the same error with every node version I have tried.

TypeError [ERR_INVALID_ARG_TYPE]: The "parentURL" argument must be of type string or an instance of URL. Received an instance of Object
at new NodeError (node:internal/errors:405:5)
at throwIfInvalidParentURL (node:internal/modules/esm/resolve:937:11)
at Hooks.resolve (node:internal/modules/esm/hooks:241:5)
at ModuleLoader.resolve (node:internal/modules/esm/loader:337:35)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:220:38)
at ModuleLoader.import (node:internal/modules/esm/loader:307:34)
at Hooks.register (node:internal/modules/esm/hooks:138:51)
at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
code: 'ERR_INVALID_ARG_TYPE'
}

@nalinikanta123
Copy link

ChristiansGithubID : Is your issue resolved?

@oleksii-pi
Copy link

Node v20.12.1 doesn't have this bug.

This comment helped me to fix it: #30217 (comment)

I could reproduce it on v20.6.0 (over nvm)

jennydaman added a commit to jennydaman/ChRIS_ui that referenced this issue Aug 25, 2024
Fixes problem with Playwright, see microsoft/playwright#29253
akm added a commit to akm/svelte-connect-todo that referenced this issue Sep 5, 2024
@Pizle0210
Copy link

I keep getting the same error

TypeError [ERR_INVALID_ARG_TYPE]: The "parentURL" argument must be of type string or an instance of URL. Received an instance of Object
at new NodeError (node:internal/errors:405:5)
at throwIfInvalidParentURL (node:internal/modules/esm/resolve:937:11)
at Hooks.resolve (node:internal/modules/esm/hooks:241:5)
at ModuleLoader.resolve (node:internal/modules/esm/loader:337:35)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:220:38)
at ModuleLoader.import (node:internal/modules/esm/loader:307:34)
at Hooks.register (node:internal/modules/esm/hooks:138:51)
at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
code: 'ERR_INVALID_ARG_TYPE'

@mxschmitt
Copy link
Member

@Pizle0210 we recommend updating to latest Node.js.

@Pizle0210
Copy link

I have and it worked

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

8 participants