Comments (20)
@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.
from dataui-nestjs-crud.
@SuzGori I just released 5.3.1-alpha.0
It has Typescript, nestjs, etc. updated.
Can you please confirm that the problem is resolved?
from dataui-nestjs-crud.
@zaro
I edited the following source and it was cured.
Do I need to pull it?
typeorm-crud.service.d.ts
export declare class TypeOrmCrudService<T extends ObjectLiteral> extends CrudService<T, DeepPartial<T>> {
Add extends ObjectLiteral
from dataui-nestjs-crud.
@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 ?
from dataui-nestjs-crud.
@zaro
Thankyou!
A minimal repository was created.
See below.
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.
from dataui-nestjs-crud.
@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 require()
instead of import, or you can try a different import syntax like import CRUD from '@dataui/...'
.
from dataui-nestjs-crud.
@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.
from dataui-nestjs-crud.
@zaro
Thanks for the reply.
I may have mistakenly thought it was a Typescript issue from the Issue.
I got the following error message and arrived at the ↑ link.
Error content
node_modules/@dataui/crud-typeorm/lib/typeorm-crud.service.d.ts:15:32 - error TS2344: Type 'T' does not satisfy the constraint 'ObjectLiteral'.
15 protected repo: Repository<T>;
from dataui-nestjs-crud.
@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.
from dataui-nestjs-crud.
Typescript and TypeORM versions are as follows
├── [email protected]
├── [email protected]
from dataui-nestjs-crud.
@zaro
Thanks for the reply.
The errors did not change.
from dataui-nestjs-crud.
@zaro
Is that what you mean?
I had assumed that others would have the same symptoms.
Then maybe it is a special case.
I am using Angular Universal to run NestJS this time.
That may have something to do with it.
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;
from dataui-nestjs-crud.
@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.)
from dataui-nestjs-crud.
@zaro
Is there anything I can do to help you?
from dataui-nestjs-crud.
@SuzGori I just got time to check your repo and I am trying to figure out what is the issue exactly.
from dataui-nestjs-crud.
@zaro
Oh wow!
Thanks for your excellent reply!
I would be happy to do something for you too!
from dataui-nestjs-crud.
@zaro
Thank you very much!
I will check it out!
from dataui-nestjs-crud.
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
from dataui-nestjs-crud.
@zaro
Thank you very much.
I will check a little on my end.
The server version of tsconfig for AngularUniversal was commonjs.
https://github.com/SuzGori/angular-universal-nest/blob/829ce5de2790b1e629fc003daf74e20535668dc7/tsconfig.server.json#L5C7-L5C7
from dataui-nestjs-crud.
@zaro
It's still unresolved.
Worst case scenario, I'll clone the repository and continue development, but I hope there's a solution.
from dataui-nestjs-crud.
Related Issues (20)
- BUG: Incorrect result on searching with combination "$and" + "$or" conditions HOT 1
- npm broken documentation links HOT 1
- Bug: GetMany with join + pagination throws duplicate column error HOT 1
- empty schema for the Entity HOT 8
- cannot set decorators globally
- transform the body without interceptors HOT 4
- Feature Request: Join Filter (ON clause) HOT 2
- Minor typo in main.yml: Docker Compose command HOT 1
- @Crud dynamic params and ManyToOne Relationships incorrect column mapping
- wrong typing HOT 2
- include soft deleted rows HOT 1
- extend CrudController HOT 2
- Tips: How to add customized filter conditions from backend service. HOT 2
- How to specify `operationId` for each route? HOT 1
- [help] how to add additional methods without overriding HOT 1
- Join Condition (on clause) not working as given in the docs HOT 2
- Support for GroupBy clause and Aggregate functions
- wrong Reflect method HOT 5
- export helpers and expose crudSwagger decorator HOT 2
- Is it possible to cascade soft delete with this library?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataui-nestjs-crud.