You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't reproduce this, the code snippet looks correct. You're probably using an "incomplete" version of the Node.js binary which can cause the error although I'm unsure how you've got an incomplete version, and the errors don't seem like errors from Node.js itself since Node.js won't point out the name of the module you imported the function from, nor would it prepend a _ (_url) to the front of the module name.
I would recommend uninstalling Node.js and reinstalling it.
There has been no activity on this issue for 11 months. The help repository works best when sustained engagement moves conversation forward. The issue will be closed in 1 month. If you are still experiencing this issue on the latest supported versions of Node.js, please leave a comment.
I want to convert a file path to an URL.
I tried to follow the indications found in the official docs: https://nodejs.org/dist/latest-v16.x/docs/api/url.html#urlpathtofileurlpath
But I get this error:
Uncaught TypeError: (0 , _url.pathToFileURL) is not a function
Or :
Error message:
_url.default.pathToFileURL is not a function
Other info:
What am I doing wrongly? How to solve the problem?
At the moment, I solved the problem using https://www.npmjs.com/package/file-url combined with this helpful suggestion for webpack configuration: facebook/create-react-app#11764 (comment)
But I would like to know if and how to correctly use the features of the node.js library
The text was updated successfully, but these errors were encountered: