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

dojo/parser::parse() error #318

Open
lrpowell opened this issue Feb 24, 2021 · 8 comments
Open

dojo/parser::parse() error #318

lrpowell opened this issue Feb 24, 2021 · 8 comments
Assignees

Comments

@lrpowell
Copy link

When launching to my chart (this is in new project location using Angular2 & dojo with Maven build process where I haven't gotten to that point yet), I am ending with an error that it looks like HtmlUnit is passing on from dojo/parser.

Feb 24, 2021 2:57:38 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'application/x-javascript'.
Feb 24, 2021 2:57:39 PM com.gargoylesoftware.htmlunit.WebConsole error
SEVERE: dojo/parser::parse() error InternalError: Could not convert JavaScript argument arg 0 (http://localhost:9080/Navigator/scripts.f1f53a09317b5a0c80d3.js#1)
Feb 24, 2021 2:57:39 PM com.gargoylesoftware.htmlunit.WebConsole error
SEVERE: TypeError: Cannot call method "watch" of undefined

Interesting thing is that I didn't think I was getting this error when running through the browser, but I do see something that could be the same when I go to console and see an error:

Bar.js:230 TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at C..A._parse (Bar.js:225)
at C..A._init (Bar.js:193)
at C..A.load (Bar.js:117)
at Core.js:302
at m (scripts.f1f53a09317b5a0c80d3.js:1)
at _1.DeferredList.v.then.then (scripts.f1f53a09317b5a0c80d3.js:1)
at initMod (Core.js:300)
at C..A._load (Core.js:496)
at Core.js:447
at Function.when (scripts.f1f53a09317b5a0c80d3.js:1)
localhost-1614204784445.log

So ideally we will fix this error and not have any problems. But it is interesting that when running on browser, we hit the error but keep on. In HtmlUnit, this is where things come to a halt. Any way we can get more info on why HtmlUnit abandons it?

@rbri
Copy link
Member

rbri commented Feb 25, 2021

this is the only real difference in the setup of HtmlUnit from real browsers - because it was developed as testing tool

webClient.getOptions().setThrowExceptionOnScriptError(false);

@lrpowell
Copy link
Author

I fixed the javascript error and will close this. Thanks

@lrpowell lrpowell reopened this Feb 25, 2021
@lrpowell
Copy link
Author

Actually, I am still getting the same error (I thought it was something else). The Bar.js error is gone, but still stopping in htmlunit.

Feb 25, 2021 9:50:56 AM com.gargoylesoftware.htmlunit.WebConsole error
Actually I realize now that this error is still there (fixed one that came out when running in the browser and was hoping they were related). So now it looks to be in the project js code. Is there a way to get any more info than file & line #? I put logging to WARNING to get more, but nothing related.

SEVERE: dojo/parser::parse() error InternalError: Could not convert JavaScript argument arg 0 (http://localhost:9080/Navigator/scripts.f1f53a09317b5a0c80d3.js#1)
Feb 25, 2021 9:50:56 AM com.gargoylesoftware.htmlunit.WebConsole error
SEVERE: TypeError: Cannot call method "watch" of undefined

@lrpowell
Copy link
Author

How can I get a stack trace or more information on this error coming out of HtmlUnit? I know it is complaining about the dojo parse and Angular generated file script js, but don't enough to go on.

@rbri
Copy link
Member

rbri commented Mar 1, 2021

Tricky.

http://localhost:9080/Navigator/scripts.f1f53a09317b5a0c80d3.js#1 - the 1 point to line source code line number - usually this is a minified and maybe obfuscated version of the js source. It will be a great help to change the app in a way to use the plain source (DEV mode). Then you are able to determine the problematic line and with a bit of luck you can see why the receiver of watch is undefined. Maybe there is a property not implemented in HtmlUnit or something like this.....

@lrpowell
Copy link
Author

lrpowell commented Mar 4, 2021

I have fully decompressed the js source but get the same error.

Mar 03, 2021 7:50:26 PM com.gargoylesoftware.htmlunit.WebConsole error
SEVERE: dojo/parser::parse() error InternalError: Could not convert JavaScript argument arg 0 (http://localhost:9080/Navigator/scripts.f1f53a09317b5a0c80d3.js#1)
Mar 03, 2021 7:50:26 PM com.gargoylesoftware.htmlunit.WebConsole error
SEVERE: TypeError: Cannot call method "watch" of undefined

to get dev mode:

under navigator-java/, run command "mvn clean install"
then under navigator-java/navigatorWar/, run command "mvn -f pom_dev.xml clean install"

attached is the script source within the Navigator server being run
scripts.f1f53a09317b5a0c80d3.js.txt

@rbri
Copy link
Member

rbri commented Mar 8, 2021

I have fully decompressed the js source but get the same error.
http://localhost:9080/Navigator/scripts.f1f53a09317b5a0c80d3.js#1

But i hope the line number is changed - what is the new number when running the decompressed source?

@lrpowell
Copy link
Author

lrpowell commented Mar 8, 2021

I am still getting the same line number (#1)...
localhost log.docx

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