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

urilib.resolve is not a function at Validator2.validate #399

Open
mamadfar opened this issue Jun 26, 2024 · 6 comments
Open

urilib.resolve is not a function at Validator2.validate #399

mamadfar opened this issue Jun 26, 2024 · 6 comments

Comments

@mamadfar
Copy link

Still, the problem with URL exists
"urilib.resolve is not a function at Validator2.validate"

FYI: I fixed it (again #367 ), just by installing url package.

It would be great if you can add url package as a dependency to jsonschema package.

@awwright
Copy link
Collaborator

@mamadfar What environment are you using? There should be a built-in require('url')

@mamadfar
Copy link
Author

I'm not sure what do you mean by What environment but, I used it with Docker and AWS, the result was the same, so I had to install it manually.

The techs that I used:

Node: 18 | 20
React: 18

@awwright
Copy link
Collaborator

I'm sorry not sure what's going on then, my Node.js v22.4.0 has the necessary function builtin:

> require('url')
{
  Url: [Function: Url],
  parse: [Function: urlParse],
  resolve: [Function: urlResolve],
  resolveObject: [Function: urlResolveObject],
  format: [Function: urlFormat],
  URL: [class URL] {
    canParse: [Function: canParse],
    createObjectURL: [Function: createObjectURL],
    revokeObjectURL: [Function: revokeObjectURL]
  },
  URLSearchParams: [class URLSearchParams],
  domainToASCII: [Function: domainToASCII],
  domainToUnicode: [Function: domainToUnicode],
  pathToFileURL: [Function: pathToFileURL],
  fileURLToPath: [Function: fileURLToPath],
  urlToHttpOptions: [Function: urlToHttpOptions]
}

@mamadfar
Copy link
Author

It should support the older version, right?
Currently, many apps are working with Node >= 20. So, it would be great if we have it with the package, in that case, no one is forced to use Node 22 or install the URL package manually.

@awwright
Copy link
Collaborator

awwright commented Aug 1, 2024

'url' has been in Node.js core since the very beginning, or very near it. I'm really not sure what's going on, without more information.

@mamadfar
Copy link
Author

mamadfar commented Aug 2, 2024

I'm not sure what is the problem, I used it again in a new project and I got the same error. #367
So, there is no more information I think 😅
Imagine a barebone React 18 project (TailwindCSS - Ant Design) and Node 18 or 20
FYI: I used Node 22 and still the same error and I used this package in a different laptop, pipeline and environment
That's the all information 😅😅

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

2 participants