Comments (5)
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.
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.
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.
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.
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)
- Transform only transforms referenced schemas HOT 1
- Hoping to wrap the client for single arg calls
- Metadata generation
- Allow client option for custom dispatcher into fetch requests (e.g. to disable certificate validation) HOT 7
- advice on how to connect a frontend (swagger?) while using this lib
- Set baseUrl per request
- 0.9.4 breaks some Typescript configurations HOT 4
- Response types from openapi-fetch ignore null values
- Multiple security schemes not supported
- With React Query: Invariant: headers() expects to have requestAsyncStorage, none available. HOT 3
- `--properties-required-by-default` and `--default-non-nullable` flags do not work HOT 2
- Nested object's properties are mapped to unknown, but in OpenAPI they are typed correctly HOT 3
- "AdditionalProperties" reflects onto existing properties and causes TypeScript compile errors HOT 1
- Issues with references (`$ref`) resolution HOT 2
- Error with negative numbers in enums HOT 2
- Allow for custom types in path params serialization (and maybe other places serialization too)
- Types derived for oneOf construct result in TS2502 error HOT 7
- Uncaught error when body is `undefined` in request init HOT 6
- 'path' does not exist in type '{ query?: Record<string, unknown> | undefined; }' HOT 4
- issue on - generate client when yaml has mutiple same external ref
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 openapi-typescript.