-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug?]: Types error with Vinxi #1346
Comments
@qlaffont , the solid start 0.5.x is compatible with vinxi 0.2.x, because they are both on vite 4.x. Vinxi 0.3 is already out, but a new versions of solid-start that uses it is still in the works in this |
Yes i know but as i say on the issue, the version of vite have a security issue so maybe we need to have an update to update to latest vinxi and vite |
Is there a new vite 4.x release out that patches this? |
If you check the context section, |
@nksaraf @ryansolid i believe this ticket boils down to a question of whether there will be patch branches for vinxi 0.2.x / solid-start 0.5.x , or if those versions are to be considered EOL in favor of vinxi 0.3+ and solid-start 0.6+: |
I don't know unfortunatly but i think we should update to 0.3 |
@qlaffont are you able to force the new vite 4 version with solid start 0.5 through the use of package.json resolutions? Any idea why it doesn't pick up the patches vite 4 automatically when it's aligned with semver to do so? |
To be honest no, because i use renovate bot to update packages automatically. But i will try when i have time. |
vinxi 0.2.1 has a package json with |
I have try to force update to vite unfortunalty it doesn't work :
|
Generally in beta old releases aren't supported. I'm sorry this took a while just there were other bugs. Let me know if stuff is good in 0.6.x |
It seems error is still present :
|
any update on the solution ? :/ |
I don't get this error locally but I can probably make it shutup. There is a reasonable thought that the router should be more generic in how it extends the Request Event types.. but I will worry about that a bit later. |
I can confirm the commit fix the issue ! Thanks ! |
@ryansolid fix is not working finally ... (cc @birkskyum 👋 ) pnpm lint
> demo-ventes@ lint /home/quentin/Documents/dev/madeformed/demo-ventes
> tsc --project tsconfig.json && eslint src --ext .ts,.tsx --fix
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/fetchEvent.ts:76:46 - error TS2345: Argument of type 'OutgoingHttpHeaders' is not assignable to parameter of type '{ [s: string]: string | string[]; } | ArrayLike<string | string[]>'.
Property 'length' is missing in type 'OutgoingHttpHeaders' but required in type 'ArrayLike<string | string[]>'.
76 return Object.entries<string | string[]>(getResponseHeaders(this.event)).forEach(([key, value]) => fn(Array.isArray(value) ? value.join(", ") : value, key, this));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es5.d.ts:1570:14
1570 readonly length: number;
~~~~~~
'length' is declared here.
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/fetchEvent.ts:76:161 - error TS2345: Argument of type 'this' is not assignable to parameter of type 'Headers'.
Type 'HeaderProxy' is not assignable to type 'Headers'.
The types returned by 'get(...)' are incompatible between these types.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
76 return Object.entries<string | string[]>(getResponseHeaders(this.event)).forEach(([key, value]) => fn(Array.isArray(value) ? value.join(", ") : value, key, this));
~~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/fetchEvent.ts:79:46 - error TS2345: Argument of type 'OutgoingHttpHeaders' is not assignable to parameter of type '{ [s: string]: string | string[]; } | ArrayLike<string | string[]>'.
79 return Object.entries<string | string[]>(getResponseHeaders(this.event)).map(([key, value]) => [
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/fetchEvent.ts:88:45 - error TS2345: Argument of type 'OutgoingHttpHeaders' is not assignable to parameter of type 'ArrayLike<string | string[]> | { [s: string]: string | string[]; }'.
Type 'OutgoingHttpHeaders' is not assignable to type 'ArrayLike<string | string[]>'.
88 return Object.values<string | string[]>(getResponseHeaders(this.event)).map((value) =>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/fetchEvent.ts:111:5 - error TS2322: Type 'HeaderProxy' is not assignable to type 'Headers'.
The types returned by 'get(...)' are incompatible between these types.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
111 headers: new HeaderProxy(event)
~~~~~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/types.ts:43:3
43 headers: Headers;
~~~~~~~
The expected type comes from property 'headers' which is declared here on type 'ResponseStub'
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/handler.ts:56:33 - error TS2769: No overload matches this call.
Overload 1 of 2, '(event: HTTPEvent, location: string, code?: number): Promise<void>', gave the following error.
Argument of type 'FetchEvent' is not assignable to parameter of type 'HTTPEvent'.
Overload 2 of 2, '(location: string, code?: number): Promise<void>', gave the following error.
Argument of type 'FetchEvent' is not assignable to parameter of type 'string'.
56 return sendRedirect(event, context.response.headers.get("Location")!);
~~~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/handler.ts:80:31 - error TS2769: No overload matches this call.
Overload 1 of 2, '(event: HTTPEvent, location: string, code?: number): Promise<void>', gave the following error.
Argument of type 'FetchEvent' is not assignable to parameter of type 'HTTPEvent'.
Overload 2 of 2, '(location: string, code?: number): Promise<void>', gave the following error.
Argument of type 'FetchEvent' is not assignable to parameter of type 'string'.
80 return sendRedirect(event, context.response.headers.get("Location")!);
~~~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/pageEvent.ts:9:27 - error TS2345: Argument of type 'FetchEvent' is not assignable to parameter of type 'HTTPEvent'.
Type 'FetchEvent' is missing the following properties from type 'H3Event<EventHandlerRequest>': "__is_event__", node, context, _handled, and 12 more.
9 const flash = getCookie(ctx, "flash");
~~~
node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/pageEvent.ts:14:13 - error TS2345: Argument of type 'FetchEvent' is not assignable to parameter of type 'HTTPEvent'.
14 setCookie(ctx, "flash", "", { maxAge: 0 });
~~~
Found 9 errors in 3 files.
Errors Files
5 node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/fetchEvent.ts:76
2 node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/handler.ts:56
2 node_modules/.pnpm/@solidjs+start@0.6.1_solid-js@1.8.15_vinxi@0.3.10_vite@5.1.5/node_modules/@solidjs/start/server/pageEvent.ts:9
ELIFECYCLE Command failed with exit code 2.
``` |
commit f5ec449f4df13c0f74613cb305c5f06c38778af6 Author: Ryan Carniato <ryansolid@gmail.com> Date: Wed Mar 6 10:44:27 2024 -0800 update config to anticipate Vite updates, clearer experimental features, routesDir commit c879a3c41cfd7ae6cf53fa3ccfff5c7b44a90a1f Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Mar 5 16:28:14 2024 -0800 fix FS router circular dep by moving import commit 336aafb79ef42550f08a1c9b987c45960421d906 Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Mar 5 14:06:58 2024 -0800 transparent errors and support http status forwarding in server fns commit fbeed39064667ed95cc448121846c5c44c7b4eb1 Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Mar 5 12:40:41 2024 -0800 bump vinxi plugins commit a34dec859a2be52ffdb4ae691bb234a43a21d444 Author: Ryan Carniato <ryansolid@gmail.com> Date: Mon Mar 4 14:00:59 2024 -0800 v0.6.1 commit db999705047582d208728ee6824ef07bcad24ede Author: Ryan Carniato <ryansolid@gmail.com> Date: Mon Mar 4 13:37:55 2024 -0800 update ts, fix #1346 flash types commit 33a66aa5d5c71a3a0dee42a78952a75b1b38f320 Author: Patrick G <doeixd@gmail.com> Date: Mon Mar 4 15:29:40 2024 -0500 Update package.json to include license (#1361) * Update package.json To include license JSDocs.io won't work without it. https://www.jsdocs.io/package/@solidjs/start * Create quiet-meals-heal.md --------- Co-authored-by: Ryan Carniato <ryansolid@gmail.com> commit 9c4c7c01cefd7c85a7e858f3d2ca72f93d165138 Author: Ryan Carniato <ryansolid@gmail.com> Date: Mon Mar 4 12:25:53 2024 -0800 update router commit 28d77d3343f1aa53e477038ad4abede83329b03c Author: Birk Skyum <74932975+birkskyum@users.noreply.github.com> Date: Mon Mar 4 18:23:32 2024 +0100 Bump vinxi to ^0.3.9 everywhere (#1358) Co-authored-by: Ryan Carniato <ryansolid@gmail.com> commit 6822b2e09753d38800b9ef7f7e7831452e48101a Author: Ryan Carniato <ryansolid@gmail.com> Date: Mon Mar 4 09:20:09 2024 -0800 unlock package.json again commit 4889606a5833b64f3c4bdf9a6ccdef8f4ca3194c Author: Ryan Carniato <ryansolid@gmail.com> Date: Thu Feb 29 10:59:25 2024 +0100 temporary lock vinxi version commit 5402007cb03000ef06b0cc3adef04a09a4b729bf Author: Alexis H. Munsayac <alexis.munsayac@gmail.com> Date: Thu Feb 29 15:12:20 2024 +0800 Fix refresh pragma (#1348) * Fix refresh pragma * Add changeset --------- Co-authored-by: Ryan Carniato <ryansolid@gmail.com> commit dd37a5bed7d586f485bfe9e3992d44160948fac6 Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Feb 27 14:32:31 2024 -0800 v0.6.0 commit 7d3355a400ddc45a12489a51f2bed6db7491578d Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Feb 27 09:16:48 2024 -0800 update vinxi, fix prerendering commit 3634dd7599552cccc0e68b9eab0091bdcbfc2d85 Author: Ryan Carniato <ryansolid@gmail.com> Date: Mon Feb 26 12:07:20 2024 -0800 configurable dev overlay commit eecc8dcfdbfc66f313ff1bd79f2d424b719c13d3 Author: Nikhil Saraf <nsaraf98@gmail.com> Date: Mon Feb 26 21:10:44 2024 +0530 Add @mdx-js/mdx dependency commit c0973a0c96b523cd4fde3c4a30c1d00b59342c4f Author: Ryan Carniato <ryansolid@gmail.com> Date: Sat Feb 24 09:24:12 2024 -0800 dedupe plugins commit 52e1f4427e9c76af0518ed05e210a4848af1f6db Author: Ryan Carniato <ryansolid@gmail.com> Date: Fri Feb 23 16:00:29 2024 -0800 move server rendering options to handler commit 03d409a650db6f5a2ead6b2e8b84c74f2a74ab5b Author: Ryan Carniato <ryansolid@gmail.com> Date: Fri Feb 23 15:40:40 2024 -0800 fix nojs flash update auth/prisma examples commit f80aedbea9ccdda29ea9a45fbba852f20aff65e1 Author: Ryan Carniato <ryansolid@gmail.com> Date: Fri Feb 23 12:25:23 2024 -0800 vite.config -> app.config commit a9cf09db7e00a643b686482b95f730f0d6ecc1be Author: Ryan Carniato <ryansolid@gmail.com> Date: Thu Feb 22 15:29:53 2024 -0800 v0.5.10 commit e3a0a09a2de989b111c20df1d5af0cd1130ca0e3 Author: Ryan Carniato <ryansolid@gmail.com> Date: Thu Feb 22 15:28:48 2024 -0800 fix nojs return responses, fix throw single flight commit fcdb8aa0ffe61a0190c15fa9d68bb3517909ac12 Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Feb 20 22:37:48 2024 -0800 handler options as function, forward nonce to main scripts commit 076aef995812eb59b379c5c017f64a303afda04e Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Feb 20 16:08:38 2024 -0800 fix #1276 - functions for plugins option commit 58e3eac56474e62d929a0d934df05d6bfbc43e6a Author: Ryan Carniato <ryansolid@gmail.com> Date: Tue Feb 20 15:24:34 2024 -0800 update some versions commit 33b471cb02d11858b4e0cc6ff156e5775f6ccb96 Author: Birk Skyum <birk.skyum@pm.me> Date: Wed Feb 14 10:10:20 2024 +0100 Vinxi 0.2.1 -> 0.3.3 commit 36b7912 Merge: d149a60 6b08018 Author: Katja Lutz <katywings@users.noreply.github.com> Date: Tue Feb 20 23:31:06 2024 +0100 Merge branch 'main' into vinxi-51-rpc-info commit d149a60 Merge: 2aac293 f787f2b Author: Katja Lutz <katywings@users.noreply.github.com> Date: Sun Feb 11 20:35:34 2024 +0100 Merge branch 'main' into vinxi-51-rpc-info commit 2aac293 Author: Katja Lutz <mail@katjalutz.ch> Date: Sun Dec 31 17:02:43 2023 +0100 feat: implement getServerFunctionMeta Refs: nksaraf/vinxi#51
Duplicates
Latest version
Current behavior 😯
Actually when I want to check types, I have :
Expected behavior 🤔
No types error
Steps to reproduce 🕹
Steps:
Context 🔦
Actually, Vinxi 0.2.1 have a critical security error with vite version, and i want to patch it with the latest version :
Your environment 🌎
The text was updated successfully, but these errors were encountered: