Code Monkey home page Code Monkey logo

Comments (5)

drwpow avatar drwpow commented on May 27, 2024 2

It seems that 0.8.2 did build without "skipLibCheck": true, but 0.9.x doesn't.

Ah that’s really helpful info, thank you. To be honest I can’t seem to get away from that setting in any of my projects; there’s always at least 1 package with type errors (sometimes caused by unexpected package version combinations). But better to not be part of the problem I suppose!

from openapi-typescript.

osmestad avatar osmestad commented on May 27, 2024

I'm getting the same errors, using pnpm and latest TS (https://github.com/tidal-music/tidal-sdk-web/actions/runs/7987626209/job/21810467698?pr=49)

from openapi-typescript.

drwpow avatar drwpow commented on May 27, 2024

Strange—those issues don’t appear anywhere in the project itself which is a pnpm monorepo (even installing from npm). Will try and reproduce manually, then see if there’s just something off with the TypeScript configuration in this project not catching these for some reason.

Just out of curiosity, are people with this error using ESM ("type": "module" in package.json)? Or CJS (default Node)?

from openapi-typescript.

ericblade avatar ericblade commented on May 27, 2024

so, all I did on that was just upgrade openapi-fetch ..

package.json:

{
  "name": "grocy-micro-ui",
  "description": "Micro UI for Grocy",
  "version": "0.0.0",
  "homepage": "",
  "private": true,
  "keywords": [
    "feathers"
  ],
  "author": {},
  "contributors": [],
  "bugs": {},
  "engines": {
    "node": ">= 20.10.0"
  },
  "feathers": {
    "language": "ts",
    "packager": "npm",
    "database": "sqlite",
    "framework": "koa",
    "transports": [
      "rest",
      "websockets"
    ],
    "schema": "typebox"
  },
  "directories": {
    "lib": "src",
    "test": "test"
  },
  "files": [
    "lib/client.js",
    "lib/**/*.d.ts",
    "lib/**/*.shared.js"
  ],
  "main": "lib/client",
  "scripts": {
    "build:openapi": "npx openapi-typescript src/grocyApi/grocyApiV4.spec.json -o src/grocyApi/grocyApiV4.d.ts && npm run bundle:client",
    "bundle:client": "npm run compile && npm pack --pack-destination ./public && cd public && npm install grocy-micro-ui-0.0.0.tgz --legacy-peer-deps",
    "compile": "shx rm -rf lib/ && tsc",
    "dev": "cross-env NODE_ENV=development nodemon -x ts-node src/index.ts",
    "start": "cross-env NODE_ENV=production node lib/",
    "mocha": "cross-env NODE_ENV=test mocha test/ --require ts-node/register --recursive --extension .ts --exit",
    "test": "cross-env NODE_ENV=test npm run migrate && npm run mocha",
    "migrate": "knex migrate:latest",
    "migrate:make": "knex migrate:make",
    "upgrade-deps": "npx npm-check-updates -u --doctor"
  },
  "dependencies": {
    "@feathersjs/adapter-commons": "^5.0.22",
    "@feathersjs/authentication": "^5.0.22",
    "@feathersjs/authentication-client": "^5.0.22",
    "@feathersjs/authentication-local": "^5.0.22",
    "@feathersjs/authentication-oauth": "^5.0.22",
    "@feathersjs/configuration": "^5.0.22",
    "@feathersjs/errors": "^5.0.22",
    "@feathersjs/feathers": "^5.0.22",
    "@feathersjs/knex": "^5.0.22",
    "@feathersjs/koa": "^5.0.22",
    "@feathersjs/schema": "^5.0.22",
    "@feathersjs/socketio": "^5.0.22",
    "@feathersjs/transport-commons": "^5.0.22",
    "@feathersjs/typebox": "^5.0.22",
    "cross-env": "^7.0.3",
    "knex": "^3.1.0",
    "openapi-fetch": "^0.8.2",
    "sqlite3": "^5.1.7",
    "winston": "^3.11.0"
  },
  "devDependencies": {
    "@feathersjs/cli": "^5.0.22",
    "@feathersjs/rest-client": "^5.0.22",
    "@types/mocha": "^10.0.6",
    "@types/node": "^20.11.19",
    "axios": "^1.6.7",
    "mocha": "^10.3.0",
    "nodemon": "^3.0.3",
    "openapi-typescript": "^6.7.4",
    "prettier": "^3.2.5",
    "shx": "^0.3.4",
    "ts-node": "^10.9.2",
    "typescript": "^5.3.3"
  }
}

I see there's a 0.9.2 now, going to give it a look

Looks like it's the same output

G:\grocy-micro-ui>npm run compile

[email protected] compile
shx rm -rf lib/ && tsc

node_modules/openapi-fetch/dist/index.d.ts:83:42 - error TS2314: Generic type 'FetchOptions' requires 1 type argument(s).

83 export type ParseAsResponse<T, O extends FetchOptions> = O extends {
                                            ~~~~~~~~~~~~

node_modules/openapi-fetch/dist/index.d.ts:119:40 - error TS2314: Generic type 'FetchOptions' requires 1 type argument(s).

119 export type FetchResponse<T, O extends FetchOptions> =
                                           ~~~~~~~~~~~~

node_modules/openapi-fetch/dist/index.d.ts:178:36 - error TS2344: Type 'M' does not satisfy the constraint 'HttpMethod'.

178   P extends PathsWithMethod<Paths, M>,
                                       ~

  node_modules/openapi-fetch/dist/index.d.ts:177:44
    177 export type ClientMethod<Paths extends {}, M> = <
                                                   ~
    This type parameter might need an `extends HttpMethod` constraint.

node_modules/openapi-fetch/dist/index.d.ts:179:31 - error TS2344: Type 'Paths[P]' does not satisfy the constraint '{}'.
  Type 'Paths[PathsWithMethod<Paths, M>]' is not assignable to type '{}'.
    Type 'Paths[Paths[keyof Paths] extends { [K in M]: any; } ? keyof Paths : never]' is not assignable to type '{}'.
      Type 'Paths[keyof Paths]' is not assignable to type '{}'.
        Type 'Paths[string] | Paths[number] | Paths[symbol]' is not assignable to type '{}'.
          Type 'Paths[string]' is not assignable to type '{}'.

179   I extends MaybeOptionalInit<Paths[P], M>,
                                  ~~~~~~~~

node_modules/openapi-fetch/dist/index.d.ts:183:28 - error TS2536: Type 'M' cannot be used to index type 'Paths[P]'.

183 ) => Promise<FetchResponse<Paths[P][M], I[0]>>;
                               ~~~~~~~~~~~


Found 5 errors in the same file, starting at: node_modules/openapi-fetch/dist/index.d.ts:83

Dropping back to 0.8.2, no errors found

G:\grocy-micro-ui>npm run compile

[email protected] compile
shx rm -rf lib/ && tsc


G:\grocy-micro-ui>

from openapi-typescript.

ozfox avatar ozfox commented on May 27, 2024

Strange—those issues don’t appear anywhere in the project itself which is a pnpm monorepo (even installing from npm). Will try and reproduce manually, then see if there’s just something off with the TypeScript configuration in this project not catching these for some reason.

I guess this is because skipLibCheck is set in tsconfig.json?

It seems that 0.8.2 did build without "skipLibCheck": true, but 0.9.x doesn't.

Just out of curiosity, are people with this error using ESM ("type": "module" in package.json)? Or CJS (default Node)?

I am using ESM ("type": "module")

from openapi-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.