nestjs / azure-database

Azure CosmosDB Database module for Nest framework (node.js) ☁️
https://nestjs.com
MIT License
105 stars 51 forks source link

Class 'AzureTableStorageService' incorrectly implements interface 'TableService' #445

Open chxpell opened 3 years ago

chxpell commented 3 years ago

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I followed the Cosmos DB section of this guide. I am using When running the app with nest start, I get the following compilation error:

node_modules/@nestjs/azure-database/dist/table-storage/azure-table.service.d.ts:2:22 - error TS2420: Class 'AzureTableStorageService' incorrectly implements interface 'TableService'.
  Property 'host' is missing in type 'AzureTableStorageService' but required in type 'TableService'.

2 export declare class AzureTableStorageService implements azure.TableService {
                       ~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/azure-storage/typings/azure-storage/azure-storage.d.ts:9330:11
    9330           host: StorageHost;
                   ~~~~
    'host' is declared here.

Found 1 error(s).

The error seems entirely contained inside of Azure's dependency, so I am guessing it is a versioning problem because I can't think of any code I wrote that would cause this.

Expected behavior

Normally with this kind of guide I would run in to some issue with Azure configuration or a problem with my code. Not a problem within @nestjs/azure-database

Minimal reproduction of the problem with instructions

Follow the guide as mentioned. Package json is below: { "name": "xxxxxxx", "version": "0.0.1", "description": "", "author": "", "private": true, "license": "UNLICENSED", "scripts": { "prebuild": "rimraf dist", "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { "@nestjs/azure-database": "^2.0.1", "@nestjs/common": "^7.6.13", "@nestjs/config": "^0.6.3", "@nestjs/core": "^7.6.13", "@nestjs/passport": "^7.1.5", "@nestjs/platform-express": "^7.6.13", "@nestjs/swagger": "^4.7.15", "@types/passport-azure-ad": "^4.0.8", "class-transformer": "^0.4.0", "class-validator": "^0.13.1", "dotenv": "^8.2.0", "passport": "^0.4.1", "passport-azure-ad": "^4.3.0", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", "rxjs": "^6.6.6" }, "devDependencies": { "@nestjs/cli": "^7.5.6", "@nestjs/schematics": "^7.2.7", "@nestjs/testing": "^7.6.13", "@types/express": "^4.17.11", "@types/jest": "^26.0.20", "@types/node": "^14.14.31", "@types/supertest": "^2.0.10", "@typescript-eslint/eslint-plugin": "^4.15.2", "@typescript-eslint/parser": "^4.15.2", "eslint": "^7.20.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-prettier": "^3.3.1", "jest": "^26.6.3", "prettier": "^2.2.1", "supertest": "^6.1.3", "ts-jest": "^26.5.2", "ts-loader": "^8.0.17", "ts-node": "^9.1.1", "tsconfig-paths": "^3.9.0", "typescript": "^4.1.5" }, "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "rootDir": "src", "testRegex": ".*\\.spec\\.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" }, "collectCoverageFrom": [ "**/*.(t|j)s" ], "coverageDirectory": "../coverage", "testEnvironment": "node" } }

What is the motivation / use case for changing the behavior?

I need to get this app to compile so I can actually write code.

Environment


Nest version: 2.0.1


For Tooling issues:
- Node version: v14.15.5  
- Platform:  macOS Big Sur 11.1

Others:

Using intelliJ 2020.3.1 and nestJS version 7.5.6
beneiltis commented 3 years ago

@cschwing use my fork: npm install --save beneiltis/azure-database#master

and it will work again. I will open a pullrequest in a few minutes but there are so many open PRs that I wanted to give you this hint because we dont know when it will be merge. At least you can continue to work :-)

Cheers Bene

beneiltis commented 3 years ago

I created a pull request for this issue 2 weeks ago. Still waiting for it to be merged :-(

manekinekko commented 3 years ago

Thank you for your patience @beneiltis – The Nestjs team is doing its best to maintain all libraries in this organization. I'd understand your understanding.