Bug 235579

Summary: www/node 11.6 simple parse of url fails
Product: Ports & Packages Reporter: rick
Component: Individual Port(s)Assignee: Walter Schwarzenfeld <w.schwarzenfeld>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (bhughes)
Version: Latest   
Hardware: Any   
OS: Any   

Description rick 2019-02-07 14:20:29 UTC
# node -p 'require("url").parse("https://www.test.com/test")'; node --version
url.js:385
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)
v11.6.0

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 freebsd_triage 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 freebsd_triage 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 :)
Comment 3 Walter Schwarzenfeld freebsd_triage 2019-08-13 12:01:47 UTC
Cannot reproduce problem. This is  feedback timeout! I close here.

If there still problems, please reopen.