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)
- client["/endpoint"].GET style call pattern to enable go-to-definition HOT 2
- immutable option and readonly arrays HOT 1
- failure on attempting to GET a binary image response HOT 3
- `--exclude-deprecated` flag is not applied to query and path HOT 2
- Query parameter serialization for objects is not the openapi default HOT 4
- Redocly not using auth headers from env var when trying to pull a yaml from a private repo HOT 3
- Operation types are being mapped incorrectly (v7) HOT 3
- Add an option to generate type aliases for schemas HOT 2
- Exception in catch block: `TypeError: Response.text: Body has already been consumed.` HOT 2
- Request Header 'Content-Type' no longer set for requests with body serialized as FormData HOT 3
- transforming enum to delete the pathname at the enum name HOT 4
- Copy the API version to output file HOT 1
- proposal: openapi-fetch new send function HOT 5
- Document Chinese support HOT 8
- Allow providing custom `Request` and `Response` HOT 1
- 7.x nullable enum bug HOT 3
- Circular reference when using inheritance & polymorhism with discriminator HOT 7
- Custom fetch options are stripped from the request. Next.js cache doesn't work properly. HOT 3
- Is there some way to generate responses as non-optional even if not 'required' in the schema? HOT 1
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.