Bug 235579 - www/node 11.6 simple parse of url fails
Summary: www/node 11.6 simple parse of url fails
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bradley T. Hughes
Depends on:
Reported: 2019-02-07 14:20 UTC by rick
Modified: 2019-03-12 21:54 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bhughes)


Note You need to log in before you can comment on or make changes to this bug.
Description rick 2019-02-07 14:20:29 UTC
# node -p 'require("url").parse("https://www.test.com/test")'; node --version
this.hostname = toASCII(this.hostname, true);

Error: Cannot convert name to ASCII
at Url.parse (url.js:385:23)
at Object.urlParse [as parse] (url.js:149:13)
at [eval]:1:16
at Script.runInThisContext (vm.js:123:20)
at Object.runInThisContext (vm.js:312:38)
at Object. ([eval]-wrapper:6:22)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at evalScript (internal/bootstrap/node.js:720:27)
at executeUserCode (internal/bootstrap/node.js:313:7)
at startExecution (internal/bootstrap/node.js:276:5)

In stepping through the debugger, I now can see that toASCII doesn't seem to be getting resolved correctly and this is causing it to fail. The definition on line 24 or url.js is as follows:

`const { toASCII } = internalBinding('config').hasIntl ? internalBinding('icu') : require('punycode');`

internalBinding('config').hasIntl is undefined so it is trying to destruct to punycode but that seems to be where the failure is occurring as 'toASCII' is defined as ƒ toASCII() { [native code] }. I see that punycode has been deprecated so not sure if that is the issue.

Likewise when I change my code to `new URL("https://www.test.com/test")`, it fails on the call to 'parse' on line 319 of internal/url.js. 'parse' is defined as ƒ parse() { [native code] } and that throws the error there.
Comment 1 Bradley T. Hughes freebsd_committer 2019-02-18 05:34:37 UTC
Hi Rick,

As I mentioned in the Github task, I am not able to reproduce this, so I am wondering if you can provide me with a bit more information as to what the problem might be.

First off, what's the output of `pkg info -d node`?

Second, can you paste the output of `env` and `locale`?
Comment 2 Bradley T. Hughes freebsd_committer 2019-03-12 21:54:02 UTC
Hi again,

Just wondering if there has been any change after the recent Node.js releases? What about pkg info -d node, env, locale output?

Thanks :)