Open menduz opened 3 years ago
Unknown error without diagnostics information.
Clone this repo: https://github.com/menduz/typed-url-params/tree/broken-branch and run make build
make build
This is the only file that should be bundled:
export declare namespace ParseUrlParams { type ParserError<T extends string> = { error: true; } & T; type CleanKey<State extends string> = string extends State ? ParserError<"CleanKey got generic string type"> : State extends `${infer Key}(${infer _})${infer Rest}` ? `${Key}${Rest}` : State; type AddUrlSection<State extends string, Memo extends Record<string, any> = {}> = string extends State ? ParserError<"AddUrlSection got generic string type"> : CleanKey<State> extends `${infer Key}/` ? AddKeyValue<Memo, Key, string> : CleanKey<State> extends `${infer Key}*${infer Rest}` ? ParseUrlParams<Rest, AddOptionalKeyValue<Memo, Key, string | string[]>> : CleanKey<State> extends `${infer Key}/${infer Rest}` ? ParseUrlParams<Rest, AddKeyValue<Memo, Key, string>> : CleanKey<State> extends `${infer Key}+${infer Rest}` ? ParseUrlParams<Rest, AddKeyValue<Memo, Key, string | string[]>> : CleanKey<State> extends `${infer Key}?${infer Rest}` ? ParseUrlParams<Rest, AddOptionalKeyValue<Memo, Key, string>> : CleanKey<State> extends `${infer Key}.${infer Rest}` ? ParseUrlParams<Rest, AddKeyValue<Memo, Key, string>> : CleanKey<State> extends `${infer Key}-${infer Rest}` ? ParseUrlParams<Rest, AddKeyValue<Memo, Key, string>> : CleanKey<State> extends `${infer Key}` ? AddKeyValue<Memo, Key, string> : ParseUrlParams<`AddUrlSection returned unexpected value for: ${State}`>; type AddKeyValue<Memo extends Record<string, any>, Key extends string, Value extends any> = Memo & { [K in Key]: Value; }; type AddOptionalKeyValue<Memo extends Record<string, any>, Key extends string, Value extends any> = Memo & { [K in Key]?: Value; }; } /** * Creates object types compliant with https://github.com/pillarjs/path-to-regexp and Express.js * @public */ export declare type ParseUrlParams<State extends string, Memo extends Record<string, any> = {}> = string extends State ? ParseUrlParams.ParserError<"ParseUrlParams got generic string type"> : State extends `${infer _}:${infer Rest}` ? ParseUrlParams.AddUrlSection<Rest, Memo> : Memo;
Expected result: I expected to have an identity function over that file since it is the only file that should be checked.
Actual result: Failure
What do you think is the cause of this problem?: I smell it may be related to the infer keyword.
infer
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
node -v
Analysis will use the bundled TypeScript version 4.0.5 *** The target project appears to use TypeScript 4.1.3 which is newer than the bundled compiler engine; consider upgrading API Extractor. ============================================================ DIAGNOSTIC: Final prepared ExtractorConfig ============================================================ { "projectFolder": "~/code/typed-url-params", "packageJson": { "bin": null, "dependencies": null, "description": "", "devDependencies": { "@microsoft/api-extractor": "^7.12.1", "typescript": "^4.1.3" }, "homepage": "https://github.com/menduz/typed-url-params#readme", "license": "MIT", "main": "dist/index.js", "name": "typed-url-params", "optionalDependencies": null, "peerDependencies": null, "private": null, "scripts": { "test": "tsc -p tsconfig.json && node dist/test.js" }, "typings": "dist/index.d.ts", "tsdocMetadata": null, "version": "1.0.0" }, "packageFolder": "~/code/typed-url-params", "mainEntryPointFilePath": "~/code/typed-url-params/dist/index.d.ts", "bundledPackages": [], "tsconfigFilePath": "~/code/typed-url-params/tsconfig.json", "overrideTsconfig": null, "skipLibCheck": true, "apiReportEnabled": true, "reportFilePath": "~/code/typed-url-params/etc/typed-url-params.api.md", "reportTempFilePath": "~/code/typed-url-params/temp/typed-url-params.api.md", "docModelEnabled": true, "apiJsonFilePath": "~/code/typed-url-params/dist/typed-url-params.api.json", "rollupEnabled": false, "untrimmedFilePath": "~/code/typed-url-params/dist/typed-url-params.d.ts", "betaTrimmedFilePath": "", "publicTrimmedFilePath": "", "omitTrimmingComments": false, "tsdocMetadataEnabled": true, "tsdocMetadataFilePath": "~/code/typed-url-params/dist/tsdoc-metadata.json", "newlineKind": "\r\n", "messages": { "compilerMessageReporting": { "default": { "logLevel": "warning" } }, "extractorMessageReporting": { "default": { "logLevel": "warning" }, "ae-forgotten-export": { "logLevel": "warning", "addToApiReportFile": true }, "ae-incompatible-release-tags": { "logLevel": "warning", "addToApiReportFile": true }, "ae-internal-missing-underscore": { "logLevel": "warning", "addToApiReportFile": true }, "ae-internal-mixed-release-tag": { "logLevel": "warning", "addToApiReportFile": true }, "ae-unresolved-inheritdoc-reference": { "logLevel": "warning", "addToApiReportFile": true }, "ae-unresolved-inheritdoc-base": { "logLevel": "warning", "addToApiReportFile": true } }, "tsdocMessageReporting": { "default": { "logLevel": "warning" } } }, "testMode": false } ============================================================ ============================================================ DIAGNOSTIC: Compiler options ============================================================ { "target": 4, "module": 1, "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "~/code/typed-url-params/dist", "strict": true, "strictNullChecks": true, "types": [], "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "configFilePath": null } ============================================================ ============================================================ DIAGNOSTIC: Root filenames ============================================================ ~/code/typed-url-params/dist/index.d.ts ============================================================ ============================================================ DIAGNOSTIC: Files analyzed by compiler ============================================================ ~/code/typed-url-params/node_modules/typescript/lib/lib.es5.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2016.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2017.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.dom.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.dom.iterable.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.webworker.importscripts.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.scripthost.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.core.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.collection.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.generator.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.iterable.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.promise.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.proxy.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.reflect.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.symbol.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2016.array.include.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2017.object.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2017.string.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2017.intl.d.ts ~/code/typed-url-params/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts ~/code/typed-url-params/node_modules/@microsoft/api-extractor/node_modules/typescript/lib/lib.es2017.full.d.ts ~/code/typed-url-params/dist/index.d.ts ============================================================ ERROR: Symbol not found for identifier:
Update: It works if I execute
rm -rf node_modules/@microsoft/api-extractor/node_modules/typescript
Summary
Unknown error without diagnostics information.
Repro steps
Clone this repo: https://github.com/menduz/typed-url-params/tree/broken-branch and run
make build
This is the only file that should be bundled:
Expected result: I expected to have an identity function over that file since it is the only file that should be checked.
Actual result: Failure
Details
What do you think is the cause of this problem?: I smell it may be related to the
infer
keyword.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
version?node -v
)?Diagnostics