-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[javascript]-LGTM.com - ERROR: Could not resolve type @regexp_anchor #2354
Comments
Thanks for your report! Could you clarify where you get these errors? Is it inside the editor in the VSCode extension, or is it when trying to run the query on the command line? And are you using the starter workspace (https://github.com/github/vscode-codeql-starter), or did you clone the query repository yourself? If it is the latter, are you up-to-date with latest master? |
I ran into the same problem in the OS x, vscode editor. I have implemented
|
Yes, I use editor in VS Code. And I think there is something wrong with javascript. cause I can run query with java code base. |
Hello Sir, I reset the project's semmlecode.javascript.dbscheme with ql/src/semmlecode.javascript.dbscheme and I can run queries successfully. But when I made a test with alert.ql in example to the javascript code: var a = location.hash; I did't receive any alert. Do I operate wrong? Thanks your time~ |
OK, I have now managed to reproduce the problem. The issue is that the database you are trying to run your query on was created with a slightly older version of CodeQL. Normally the extension should realise this and ask you whether you want to upgrade the database before running the query, but for some reason in this case it fails to do so. This is a bug in the extension which I have reported as github/vscode-codeql#168. In the meantime, you can fix the problem by explicitly upgrading the database: in the "CodeQL" view, right-click on the database, then choose "Upgrade database". Afterwards you should be able to run your query without errors.
This is a very bad idea and I would advise strongly against doing this in future, since it may leave you with an unusable database. Use the "Upgrade database" menu mentioned above instead.
What alert were you expecting? |
github/vscode-codeql#168 has been merged. Could you check whether this fixes the problem by upgrading to the latest version of the extension? |
Hello Sir,
I met some compile errors while dealing with javascript. I tried other lanague like java and it performs well. And I use OS x. Here are errors
1. ERROR: Could not resolve type @regexp_anchor ql/javascript/ql/src/semmle/javascript/Regexp.qll:304:40:304:54
2. ERROR: Could not resolve type @regexp_normal_constant
l/javascript/ql/src/semmle/javascript/Regexp.qll:564:52:564:75
3.ERROR: test is always false, as StringLiteral is incompatible with the expression type RegExpParent.
ql/javascript/ql/src/semmle/javascript/Regexp.qll:150:42:150:55
4.ERROR: StringLiteral is incompatible with RegExpParent
ql/javascript/ql/src/semmle/javascript/Expr.qll:419:32:419:33
The text was updated successfully, but these errors were encountered: