-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why don't you raise the version of Typeorm? #17
Comments
@SuzGori can you provide a bit more information what exactly is your problem ? The issue linked is really about TypeORM, and there is nothing stopping you from using this library with newer typescript version. |
@zaro Error content
|
@SuzGori what versions or TypeORM and TypeScript are you using ? If possible it will be very helpful if you can provide with a minimal reproduction example repo. |
Typescript and TypeORM versions are as follows ├── [email protected] |
@zaro typeorm-crud.service.d.ts export declare class TypeOrmCrudService<T extends ObjectLiteral> extends CrudService<T, DeepPartial<T>> { Add extends ObjectLiteral |
@SuzGori I just released It has Typescript, nestjs, etc. updated. Can you please confirm that the problem is resolved? |
@zaro |
@SuzGori I updated typescript & typeorm in the alpha because I assumed the older versions were the cause for the error. Thank you for opening the PR, but I want to first understand how is this error happening ? Generally the TypeORM models do NOT extend ObjectLiteral , so I am very curious why is this happening in your case . Can you also provide the model you get this error from ? |
@zaro Then maybe it is a special case. I am using Angular Universal to run NestJS this time. Model is very simple. @PrimaryGeneratedColumn('uuid')
uuid: string | undefined;
@Column({ type: 'text', nullable: true })
name: string | undefined;
@CreateDateColumn({ type: 'timestamp', nullable: true })
created_at: Date | undefined;
@UpdateDateColumn({ type: 'timestamp', nullable: true })
updated_at: Date | undefined; |
@SuzGori OK I have no idea what angular universal is 😊 I meant the whole model class, the actual columns are irrelevant, but any parent classes will definitely matter. You see, if it was simply typeorm / typescript version this would have shown in the tests. But it doesn't, and I think it somewhat specific to your setup. The bets thing you can do is create a minimal reproduction example, so that I can debug it myself. Else please at least provide a complete model definition that causes the error and also how exactly do you run it ( angular universal, etc.) |
@zaro https://github.com/SuzGori/angular-universal-nest You can also JIT compile with the following command. npm ci
npm run dev:ssr
Note: This repository does not contain DB libraries. |
@zaro |
@SuzGori I just got time to check your repo and I am trying to figure out what is the issue exactly. |
@zaro |
@SuzGori please check version 5.3.1-alpha.3 . I did test with your repo and seems fine. Once you confirm, I am going to publish it as release version. |
@zaro |
I am having trouble with the following webpack error. TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at objKeys (/Users/user/dir/project/dist/app/server/vendor.js:1795:31) vendor.js:1795:31 is below /***/ 6844:
/*!********************************************************!*\
!*** ./node_modules/@dataui/crud-util/lib/obj.util.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.getOwnPropNames = exports.objKeys = void 0;
const objKeys = val => Object.keys(val); // <--- Error
exports.objKeys = objKeys;
const getOwnPropNames = val => Object.getOwnPropertyNames(val);
exports.getOwnPropNames = getOwnPropNames;
/***/ }), another at Object.26414 (/Users/user/dir/project/dist/app/server/vendor.js:230:35) /***/ 26414:
/*!************************************************************************!*\
!*** ./node_modules/@dataui/crud-request/lib/request-query.builder.js ***!
\************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.RequestQueryBuilder = void 0;
const crud_util_1 = __webpack_require__(/*! @dataui/crud-util */ 80308);
const qs_1 = __webpack_require__(/*! qs */ 29754);
const request_query_validator_1 = __webpack_require__(/*! ./request-query.validator */ 57996); // <-- Error
class RequestQueryBuilder {
constructor() { and another at Object.70722 (/Users/user/dir/project/dist/app/server/vendor.js:3474:24) /***/ 70722:
/*!********************************************************************************!*\
!*** ./node_modules/@dataui/crud/lib/interceptors/crud-request.interceptor.js ***!
\********************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length,
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.CrudRequestInterceptor = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ 49086);
const crud_request_1 = __webpack_require__(/*! @dataui/crud-request */ 68230); //<---Error |
@SuzGori Now this is most probably because of different TS module settings for your project and the library. Unfortunately I can't help you with that, but her is what I think about the problem ( take it with a gain of salt, it might be rubbish): The library is compiled with "commonjs" (https://github.com/gid-oss/dataui-nestjs-crud/blob/master/tsconfig.json#L3) as the module system for most wide compatibility, and andgular universal uses the much newer : https://github.com/SuzGori/angular-universal-nest/blob/main/tsconfig.json#L20 I have no idea how to resolve that currently, usually what helps is using |
@zaro |
@zaro |
I am having trouble with the following error.
The version of Typescript seems to be old.
typeorm/typeorm#9357
The text was updated successfully, but these errors were encountered: