Skip to content

webpack.config.js affects the parser behavior? #18651

@Anemone95

Description

@Anemone95

Hi, here is the problem. If I have a ./dir/main.jsx file with content:

function f(e, t, n, o, eo, d, Xn, Wo, Qo, qo, No) {
    return function () {
        "use strict";
        var to = () => eo ? d().createElement(Xn, null,
            <script type="text/javascript">{`<h1>aa</h1>`}</script>) : null;
        const Ho = Wo ? setImmediate : Qo ? (Vo = `axios@${Math.random()}`, qo = [], No.addEventListener("message", ({source: e, data: t}) => {
        }, 1), e => {
        }) : e => setTimeout(e);
    }();
};

If I build a database for ./dir, I get the problem:

codeql database create --language=javascript codeql-database --source-root=./dir --overwrite

Initializing database at ...
[2025-02-02 17:30:48] [build-stderr] Only found JavaScript or TypeScript files that were empty or contained syntax errors.
...

But if I create a ./dir/webpack.config.js and the content is:

module.exports = {};

I won't face that issue.

So why that happened? Will CodeQL update its parser configuration by webpack.config.js?

Besides, the CodeQL version is 2.20.1.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions