Repository navigation
Error while compiling with version 2.6.4 #28
Copy link
Copy link
Closed
Description
Hello there,
I just installed the new version and I'm trying to validate this simple schema:
import { enumOf, objectOf, } from "@altostra/type-validations"
import { string } from "@altostra/type-validations/lib/primitives"
type Methods = 'get' | 'post';
export interface HookConfiguration {
name: string,
route: string,
method: Methods
}
export const validConf = objectOf({
name: string,
route: string,
method: enumOf<Methods>('get', 'post')
})
When I compile the project, the transpiler emits this error:
node_modules/@altostra/type-validations/lib/index.d.ts:2:15 - error TS1005: ',' expected.
2 export { type RejectionsCollector, type ArrayRejectionReasons, type ValidationRejection, CUSTOM_TYPE, createRejectionsCollector, arrayRejectionReasons, asPredicate, mapRejection, setValidatorRejection, typeValidatorType, } from './RejectionReasons';
~~~~~~~~~~~~~~~~~~~
node_modules/@altostra/type-validations/lib/index.d.ts:2:41 - error TS1005: ',' expected.
2 export { type RejectionsCollector, type ArrayRejectionReasons, type ValidationRejection, CUSTOM_TYPE, createRejectionsCollector, arrayRejectionReasons, asPredicate, mapRejection, setValidatorRejection, typeValidatorType, } from './RejectionReasons';
~~~~~~~~~~~~~~~~~~~~~
node_modules/@altostra/type-validations/lib/index.d.ts:2:69 - error TS1005: ',' expected.
2 export { type RejectionsCollector, type ArrayRejectionReasons, type ValidationRejection, CUSTOM_TYPE, createRejectionsCollector, arrayRejectionReasons, asPredicate, mapRejection, setValidatorRejection, typeValidatorType, } from './RejectionReasons';
~~~~~~~~~~~~~~~~~~~
This is my tsconfig.json:
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"rootDir": "./src",
"outDir": "./build",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"alwaysStrict": true,
"skipLibCheck": true
}
}
It seems that downgrading to 2.6.1-1 fixes the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
manelcecs commentedon Sep 5, 2022
Same here!
There are errors in the
index.d.tsfile.Any change to get this addressed soon or do we need to downgrade?
ShlomiAltostra commentedon Sep 5, 2022
I apologize for the inconvenience
This is due to separate type-exports from the "normal" value exports - a feature that adds transparency for which imports are omitted in transpilation and which are transpiled to JS.
microsoft/TypeScript#45998
Please update typescript to version 4.5 or above to resolve the issue