Skip to content
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

Houdini doesn't work with new TS v4.9 satisfies operator #765

Closed
524c opened this issue Dec 15, 2022 · 2 comments · Fixed by #767
Closed

Houdini doesn't work with new TS v4.9 satisfies operator #765

524c opened this issue Dec 15, 2022 · 2 comments · Fixed by #767

Comments

@524c
Copy link
Contributor

524c commented Dec 15, 2022

Describe the bug

The Sveltekit generate TS with new satisfies operator since this PR.

I updated my code hooks.server.ts to use this, like this example, and I get an error.

The output after running the houdini generate -v command and updating my hooks.server.ts to use this new operator:

❌ Encountered error in src/hooks.server.ts
    at file:///devel/.local/share/pnpm/global/5/.pnpm/houdini@0.18.1/node_modules/houdini/build/cmd-esm/index.js:76213:15
    at async Promise.all (index 2)
    at async collectDocuments (file:///devel/.local/share/pnpm/global/5/.pnpm/houdini@0.18.1/node_modules/houdini/build/cmd-esm/index.js:76188:3)
    at async compile (file:///devel/.local/share/pnpm/global/5/.pnpm/houdini@0.18.1/node_modules/houdini/build/cmd-esm/index.js:76080:21)
    at async Command2.generate 
(file:///devel/.local/share/pnpm/global/5/.pnpm/houdini@0.18.1/node_modules/houdini/build/cmd-esm/index.js:76375:5)

Severity

serious, but I can work around it

Steps to Reproduce the Bug

It is possible to use houdini/e2e/sveltekit to reproduce the error, and then:

update the src/hooks.server.ts with with this code:

import { setSession } from '$houdini';
import type { Handle } from '@sveltejs/kit';

export const handle = (async ({ event, resolve }) => {
  // set the session information for this event
  setSession(event, { user: { token: '1234-Houdini-Token-5678' } });

  // pass the event onto the default handle
  return await resolve(event);
}) satisfies Handle;

then run houdini generate -v

Reproduction

No response

@524c 524c changed the title Houdini doesn't work with new TS v4.9 satisfaction operator Houdini doesn't work with new TS v4.9 satisfies operator Dec 15, 2022
@AlecAivazis
Copy link
Collaborator

Oh damn! Good catch. So this happens here. Do you have the time to hunt down the latest version of @babel/parser and bumping the version to support this?

@524c
Copy link
Contributor Author

524c commented Dec 15, 2022

OK good. I'll look into that and submit a PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants