cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Kläs (JIRA) <j...@apache.org>
Subject [jira] [Updated] (CB-14198) Error when running simulate with --target parameter on non-US windows 10
Date Tue, 10 Jul 2018 09:11:00 GMT

     [ https://issues.apache.org/jira/browse/CB-14198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Peter Kläs updated CB-14198:
----------------------------
    Description: 
When running cordova simulate with a specific browser, e.g.
{code:java}
 simulate android --target=chrome
{code}
the simulation does not start but instead throws an error:
{code:java}
C:\Users\pk\AppData\Roaming\npm\node_modules\cordova-simulate\node_modules\cordova-serve\src\browser.js:224
                    if (fs.existsSync(trimRegPath(result[2]))) {
                                                       
^

TypeError: Cannot read property '2' of null
    at C:\Users\pk\AppData\Roaming\npm\node_modules\cordova-simulate\node_modules\cordova-serve\src\browser.js:224:57
    at ChildProcess.exithandler (child_process.js:267:7)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12)
{code}
Reason is a language-dependent result from reg.exe when querying the path/to/browser in the
regex line 201 in browser.js.The output from reg.exe for chrome (parameter stdout) is in my
configuration:
{code:java}
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.EXE
    (Standard)    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
{code}
But the code expects (Note (Standard) vs. (Default)) :
{code:java}
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.EXE
    (Default)    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
{code}
To fix, i would suggest changing the regex in 

[https://github.com/apache/cordova-serve/blob/1667227ce3706cc0a27c065a300bce083c3799ee/src/browser.js#L201]

from
{code:javascript}
var regItemPattern = /\s*\(Default\)\s+(REG_SZ)\s+([^\s].*)\s*/;
{code}
to
{code:javascript}
var regItemPattern = /\s*\(.*\)\s+(REG_SZ)\s+([^\s].*)\s*/;
{code}
to match most translations.

Regards

Peter

 

  was:
When running cordova simulate with a specific browser, e.g.
{code:java}
 simulate android --target=chrome
{code}
the simulation does not start but instead throws an error:
{code:java}
C:\Users\pk\AppData\Roaming\npm\node_modules\cordova-simulate\node_modules\cordova-serve\src\browser.js:224
                    if (fs.existsSync(trimRegPath(result[2]))) {
                                                       
^

TypeError: Cannot read property '2' of null
    at C:\Users\pk\AppData\Roaming\npm\node_modules\cordova-simulate\node_modules\cordova-serve\src\browser.js:224:57
    at ChildProcess.exithandler (child_process.js:267:7)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12)
{code}
Reason is a language-dependent result from reg.exe when querying the path/to/browser in the
regex line 201 in browser.js.The output from reg.exe for chrome (parameter stdout) is in my
configuration: 
{code:java}
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.EXE
    (Standard)    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
{code}
But the code expects (Note (Standard) vs. (Default)) :
{code:java}
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.EXE
    (Default)    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
{code}
To fix, i would suggest changing the regex in line 201 from
{code:javascript}
var regItemPattern = /\s*\(Default\)\s+(REG_SZ)\s+([^\s].*)\s*/;
{code}
to
{code:javascript}
var regItemPattern = /\s*\(.*\)\s+(REG_SZ)\s+([^\s].*)\s*/;
{code}
to match most translations.

Regards

Peter

 


> Error when running simulate with --target parameter on non-US windows 10
> ------------------------------------------------------------------------
>
>                 Key: CB-14198
>                 URL: https://issues.apache.org/jira/browse/CB-14198
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-serve
>    Affects Versions: cordova-serve@2.0.1
>         Environment: * Windows 10 German Version 1703
>  * cordova@8.0.0
>  * cordova-simulate@0.4.0
>  * cordova-serve@2.0.1
>            Reporter: Peter Kläs
>            Priority: Major
>              Labels: windows
>
> When running cordova simulate with a specific browser, e.g.
> {code:java}
>  simulate android --target=chrome
> {code}
> the simulation does not start but instead throws an error:
> {code:java}
> C:\Users\pk\AppData\Roaming\npm\node_modules\cordova-simulate\node_modules\cordova-serve\src\browser.js:224
>                     if (fs.existsSync(trimRegPath(result[2]))) {
>                                                        
^
> TypeError: Cannot read property '2' of null
>     at C:\Users\pk\AppData\Roaming\npm\node_modules\cordova-simulate\node_modules\cordova-serve\src\browser.js:224:57
>     at ChildProcess.exithandler (child_process.js:267:7)
>     at emitTwo (events.js:126:13)
>     at ChildProcess.emit (events.js:214:7)
>     at maybeClose (internal/child_process.js:925:16)
>     at Socket.stream.socket.on (internal/child_process.js:346:11)
>     at emitOne (events.js:116:13)
>     at Socket.emit (events.js:211:7)
>     at Pipe._handle.close [as _onclose] (net.js:557:12)
> {code}
> Reason is a language-dependent result from reg.exe when querying the path/to/browser
in the regex line 201 in browser.js.The output from reg.exe for chrome (parameter stdout)
is in my configuration:
> {code:java}
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.EXE
>     (Standard)    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
> {code}
> But the code expects (Note (Standard) vs. (Default)) :
> {code:java}
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.EXE
>     (Default)    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
> {code}
> To fix, i would suggest changing the regex in 
> [https://github.com/apache/cordova-serve/blob/1667227ce3706cc0a27c065a300bce083c3799ee/src/browser.js#L201]
> from
> {code:javascript}
> var regItemPattern = /\s*\(Default\)\s+(REG_SZ)\s+([^\s].*)\s*/;
> {code}
> to
> {code:javascript}
> var regItemPattern = /\s*\(.*\)\s+(REG_SZ)\s+([^\s].*)\s*/;
> {code}
> to match most translations.
> Regards
> Peter
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message