bug with import in Nestjs
See original GitHub issueHello, @stalniy. You library is very rich and interesting and I wanna use it in my project, but I faced a strange problem i cannot bypass
Describe the bug After installation and an attempt to import “defineAbility” from the library multiple errors in console apperar
To Reproduce Steps to reproduce the behavior:
import { defineAbility } from '@casl/ability';
My tsconfig.file:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "dist"]
}
Expected behavior When I run my project with nest start --watch, i encounter such errors:
` backend_1 | node_modules/@casl/ability/dist/types/matchers/conditions.d.ts:35:13 - error TS1005: ‘;’ expected. backend_1 | backend_1 | 35 export type { MongoQueryFieldOperators, MongoQueryTopLevelOperators, MongoQueryOperators, } from ‘@ucast/mongo2js’; backend_1 | ~ backend_1 | backend_1 | node_modules/@casl/ability/dist/types/matchers/conditions.d.ts:35:91 - error TS1109: Expression expected. backend_1 | backend_1 | 35 export type { MongoQueryFieldOperators, MongoQueryTopLevelOperators, MongoQueryOperators, } from ‘@ucast/mongo2js’; backend_1 | ~ backend_1 | backend_1 | node_modules/@casl/ability/dist/types/matchers/conditions.d.ts:35:98 - error TS1005: ‘;’ expected. backend_1 | backend_1 | 35 export type { MongoQueryFieldOperators, MongoQueryTopLevelOperators, MongoQueryOperators, } from ‘@ucast/mongo2js’; backend_1 | ~~~~~~~~~~~~~~~~~ backend_1 | backend_1 | node_modules/@casl/ability/dist/types/types.d.ts:1:13 - error TS1005: ‘=’ expected. backend_1 | backend_1 | 1 import type { Condition } from ‘@ucast/mongo2js’; backend_1 | ~ backend_1 | backend_1 | node_modules/@casl/ability/dist/types/types.d.ts:1:32 - error TS1005: ‘;’ expected. backend_1 | backend_1 | 1 import type { Condition } from ‘@ucast/mongo2js’; backend_1 | ~~~~~~~~~~~~~~~~~ backend_1 | backend_1 | node_modules/@ucast/js/dist/types/index.d.ts:4:1 - error TS1128: Declaration or statement expected. backend_1 | backend_1 | 4 export type { JsInterpretationOptions, JsInterpreter } from ‘./types’; backend_1 | ~~~~~~ backend_1 | backend_1 | node_modules/@ucast/js/dist/types/index.d.ts:4:13 - error TS1005: ‘;’ expected. backend_1 | backend_1 | 4 export type { JsInterpretationOptions, JsInterpreter } from ‘./types’; backend_1 | ~ backend_1 | backend_1 | node_modules/@ucast/js/dist/types/index.d.ts:4:61 - error TS1005: ‘;’ expected. backend_1 | backend_1 | 4 export type { JsInterpretationOptions, JsInterpreter } from ‘./types’; backend_1 | ~~~~~~~~~ backend_1 | backend_1 | [10:30:15 AM] Found 16 errors. Watching for file changes.
`
Interactive example (optional, but highly desirable) provide a link to the example from http://repl.it/, https://codesandbox.io/ or similar, so we can quickly test and provide feedback. Otherwise
CASL Version
@casl/ability
- “^5.1.2”
Environment:
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
“typescript”: “3.7.4”
yes, i tried also on boilerplate nest project where current typescript version is “3.9.7” and everything ok. I updated my project and problem is gone. Thank you