[Bug] AppVerifier chokes on JavaScript regexp
Locked
-
Freitag, 15. Juni 2012 07:45
This code
suggestion = /^(\w+):(.+)/.exec(element.tag);
is perfectly legal JS and runs well in our app. However the appcert.exe is complaining about possible errors in the JS file. Wrapping the regex in this code
new RegExp("^(\\w+):(.+)").exec(element.tag);
lets the code pass in appcert.
I would like the error message to be more descriptive what exactly the appverifier has found that he thinks is invalid JS code. And I always have to smile to its serious solution to the problem being: "Exclude the file from the project". Uhmm yeah and what about the functionality it provides to the app?!
- Verschoben Jesse_FMicrosoft Contingent Staff Freitag, 15. Juni 2012 14:28 coding question (From:Windows Store: Publishing Metro Style apps for Windows 8)
Alle Antworten
-
Dienstag, 19. Juni 2012 17:46Moderator
I have filed a bug for this Phil!
Jeff Sanders (MSFT)
- Als Antwort vorgeschlagen Jeff SandersMicrosoft Employee, Moderator Dienstag, 19. Juni 2012 17:46
- Als Antwort markiert Dino HeModerator Montag, 9. Juli 2012 10:35
-
Dienstag, 19. Juni 2012 17:48Thanks Jeff. Is there a way for us to file such bugs too (connect) ?
-
Dienstag, 19. Juni 2012 18:44
Hi Phil,
Can you look at the final report generated by the Windows App Certification Kit and tell me the exact error reported by the test?
Thanks,
Salil Bapat (MSFT) -
Dienstag, 19. Juni 2012 19:09
Its just a generic error that says:
"File xxx has JavaScript syntax or other problems"
It would be really nice to see a line and column mentioned here :) Thanks
-
Mittwoch, 20. Juni 2012 00:28
Hi Phil,
I'm looking into the issue you reported and have not been able to reproduce the bytecode failure with the regular expression you provided above using the VS Blank Template default.js's onactivated handler.
I was wondering if you could provide some details from the event log as follows:
1. Win+R to run "eventvwr"
2. Navigate down the following path: "Applications and Services Logs -> Microsoft -> Windows -> AppXDeployment-Server -> Microsoft-Windows-AppXDeploymentServer/Operational"
3. There should be an Event ID with the value 548
4. In the "General" view there should be a string similar to "0x0 Failed to generate bytecode for <file> in package <package>. Skipping bytecode generation for this file."
Can you reply with the hex value at the beginning of the string?
Thanks,
Nick Eubanks (MSFT)
-
Mittwoch, 20. Juni 2012 10:34
Thank Nick,
I was able to find some errors in the event log, but not the 548. I try to reproduce it.
However, I am currently unable to start the verifier after package creation. It always fails with "Verification canceled" error. No matter what, reboot, rebuild, clean.
-
Mittwoch, 20. Juni 2012 17:42
Thanks Phil, if you come across the failure again in that test you can also reply here with the line containing the error code in the bytecodegenerationcheck log file found here:
"C:\Users\<user>\AppData\Local\Microsoft\AppCertKit\post_process_trace_BytecodeGenerationCheck_<time of run>.txt"
That should contain the same information as in the event log but is overwritten each time you launch the appcertkit.
I'm not sure why the verifier isn't starting for you after creation, is that trying to run it from Visual Studio? You can also try launching it stand-alone by searching for Windows App Cert Kit from the Start screen.
Nick Eubanks (MSFT)
Nick Eubanks (MSFT)
-
Donnerstag, 21. Juni 2012 09:06
You know, Nick, one of my colleagues tried it out again yesterday an the very same regex now passes the cert process. I have no idea what was wrong with it before, but it was reproducible.
Another, related bug, is that for some files from the datajs globalization library, the cert complains about invalid JS at the very last line and char of some l18n files included in that library. The content of the file at that position is the end of a multiline comment " */". Removing the comment from the files allows the files to pass cert. Maybe you can check whats wrong with the appverifier parser?
Thats one of the files, that failed:
http://code.google.com/p/datejs/source/browse/trunk/src/globalization/es-VE.js -
Freitag, 22. Juni 2012 13:46
This issue is coming and going randomly.
- File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\sw-KE.js has JavaScript syntax or other problems.
- File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\nl-BE.js has JavaScript syntax or other problems.
- File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\mt-MT.js has JavaScript syntax or other problems.
- File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\et-EE.js has JavaScript syntax or other problems.
- File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\es-VE.js has JavaScript syntax or other problems.
- File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\es-Latn-AZ.js has JavaScript syntax or other problems.
The same validation was ok, when run for the x64 build with the same set of files in the package. The parser seems to have a serious issue with multiline comments.
-
Freitag, 22. Juni 2012 13:49Moderator
Phil,
Could you contact me offline? If we can get the project and try and repro in-house we could nail this quicker!
-Jeff
Jeff Sanders (MSFT)
-
Freitag, 22. Juni 2012 17:00
When you say coming and going randomly, do you mean running the app cert kit on the same package and getting different results each time? If that's the case it would be very helpful to get a copy to take a look at what's going on as Jeff mentioned. I'll take a look at the globalization files available at the link you provided today to see if I can repro what you're seeing.
-Nick
Nick Eubanks (MSFT)
-
Montag, 25. Juni 2012 22:53
Hey Phil, so I loaded some of these files into an empty project to check out what was going on. Turns out that the files that failed the bytecode generation test just don't have a byte order mark (signature) which should also show up as a failure in the File Encoding test in the app cert kit.
Fortunately, this one has an extremely simple fix in Visual Studio:
- Load the file in VS and from the File menu select "Advanced Save Options..."
- Then from the drop down select: "Unicode (UTF-8 with signature) - Codepage 65001" (make sure it's the one with signature)
- Then press OK, rebuild the project and you should be good to go.
Nick Eubanks (MSFT)
- Als Antwort vorgeschlagen Nick A EubanksMicrosoft Employee Montag, 25. Juni 2012 22:53
-
Montag, 25. Juni 2012 22:55Nick, sorry for the confusion. The WACK errors also showed up when the files all had the BOM already. I will post the result XML later, when we rerun the WACK.
-
Dienstag, 29. Januar 2013 13:13
I'm facing an issue just like this one when running AppCertKit.
Same app was package with no problrms before. I know for a fact that the encoding in every file is fine...
Looking forward for a solution here
http://bit.ly/sebagomez
-
Dienstag, 29. Januar 2013 15:10Moderator
Hi Sebastian,
Please list exactly what you issue is. There are many issues referenced in this post.
Better yet, start a new thread and specify exactly what you are doing and the error.
-Jeff
Jeff Sanders (MSFT)
- Als Antwort markiert Jeff SandersMicrosoft Employee, Moderator Dienstag, 29. Januar 2013 15:10

