I encountered a problem while trying to compile TypeScript, resulting in the following error related to @cliqz/adblocker
:
node_modules/@cliqz/adblocker/dist/commonjs/request.d.ts:12:37 - error TS2503: Cannot find namespace 'browser'.
12 export type WebRequestTypeFirefox = browser.webRequest.ResourceType;
The version of @cliqz/adblocker causing this issue is 1.30.0, with node v20.15.1
This is my tsconfig.json file:
{
"compilerOptions": {
"target": "es2017",
"outDir": "build",
"rootDir": "src",
"moduleResolution": "node",
"module": "commonjs",
"declaration": true,
"inlineSourceMap": true,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */,
"noUnusedParameters": true /* Report errors on unused parameters. */,
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
/* Debugging Options */
"traceResolution": false /* Report module resolution log messages. */,
"listEmittedFiles": false /* Print names of generated files part of the compilation. */,
"listFiles": false /* Print names of files part of the compilation. */,
"pretty": true /* Stylize errors and messages using color and context. */,
"lib": ["es2017", "dom"],
"types": ["jest", "node", "puppeteer", "winston", "chrome"],
"typeRoots": ["node_modules/@types", "src/types"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts", "__tests__"]
}