Giter Site home page Giter Site logo

Comments (16)

qlaffont avatar qlaffont commented on July 26, 2024 1

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

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024 1

If you check the context section,
Patched version >=4.5.2

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024 1

It seems error is still present :


node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/pageEvent.ts:28:9 - error TS2322: Type 'FetchEvent & { manifest: object; assets: string[]; router: { submission: any[] | { url: any; result: any; input: any[]; }; }; routes: any[]; $islands: Set<string>; }' is not assignable to type 'PageEvent'.
  The types of 'router.submission' are incompatible between these types.
    Type 'any[] | { url: any; result: any; input: any[]; }' is not assignable to type 'Submission<any, any>'.
      Type 'any[]' is missing the following properties from type 'Submission<any, any>': input, pending, url, clear, retry

28   const pageEvent: PageEvent = Object.assign(ctx, {
           ~~~~~~~~~

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024 1

I can confirm the commit fix the issue ! Thanks !

from solid-start.

birkskyum avatar birkskyum commented on July 26, 2024

@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 next branch https://github.com/solidjs/solid-start/tree/next

from solid-start.

birkskyum avatar birkskyum commented on July 26, 2024

Is there a new vite 4.x release out that patches this?

from solid-start.

birkskyum avatar birkskyum commented on July 26, 2024

@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+:

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024

I don't know unfortunatly but i think we should update to 0.3

from solid-start.

birkskyum avatar birkskyum commented on July 26, 2024

@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?

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024

To be honest no, because i use renovate bot to update packages automatically. But i will try when i have time.

from solid-start.

birkskyum avatar birkskyum commented on July 26, 2024

vinxi 0.2.1 has a package json with "vite": "4.5.0", instead of i.e. "vite": "^4.5.0", so it unfortunately doesn't propagate security patches automatically.

https://github.com/nksaraf/vinxi/blob/b7b73bb1c8741fb012a05602cd140bcc6307be38/packages/vinxi/package.json#L192

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024

I have try to force update to vite unfortunalty it doesn't work :

  "pnpm": {
    "overrides": {
      "vite": "4.5.2"
    }
  },
tsc --project tsconfig.json && eslint src --ext .ts,.tsx --fix

node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/pageEvent.ts:28:9 - error TS2322: Type 'FetchEvent & { manifest: object; assets: string[]; router: { submission: any[] | { url: any; result: any; input: any[]; }; }; routes: any[]; $islands: Set<string>; }' is not assignable to type 'PageEvent'.
The types of 'router.submission' are incompatible between these types.
  Type 'any[] | { url: any; result: any; input: any[]; }' is not assignable to type 'Submission<any, any>'.
    Type 'any[]' is missing the following properties from type 'Submission<any, any>': input, pending, url, clear, retry

28   const pageEvent: PageEvent = Object.assign(ctx, {
         ~~~~~~~~~


Found 1 error in node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/pageEvent.ts:28

 ELIFECYCLE  Command failed with exit code 2.
 ```

from solid-start.

ryansolid avatar ryansolid commented on July 26, 2024

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

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024

any update on the solution ? :/

from solid-start.

ryansolid avatar ryansolid commented on July 26, 2024

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.

from solid-start.

qlaffont avatar qlaffont commented on July 26, 2024

@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/@[email protected][email protected][email protected][email protected]/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/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1570:14
    1570     readonly length: number;
                      ~~~~~~
    'length' is declared here.

node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/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/@[email protected][email protected][email protected][email protected]/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.
 ```

from solid-start.

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.