Closed MonsterDeveloper closed 11 months ago
Are yu using pnpm
, @MonsterDeveloper? This might be related to microsoft/TypeScript#47663.
On my local machine yes, but I was able to reproduce the bug in CodeSandbox that uses yarn as well. Furthermore, Inngest is the only library in my project giving that error in composite mode, which makes me think it’s not an issue with the compiler.
Although I don’t know what is it caused by and can’t think of a possible fix. On 7. Nov 2023 at 16:40 +0100, Jack Williams @.***>, wrote:
Are yu using pnpm, @MonsterDeveloper? This might be related to microsoft/TypeScript#47663. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
@jpwilliams after a bit of research, it seems to me that it is indeed an issue with the TypeScript compiler. I found a temporary fix — importing the types from the error directly:
import { InngestFunction } from "../node_modules/inngest/components/InngestFunction";
import type * as InngestTypes from "../node_modules/inngest/types";
// no errors now
export default inngest.createFunction(
{ id: "send-welcome-email" },
{ event: "user/new.signup" },
async () => {
return "some action";
},
);
But because inngest
package doesn't export the types from types
folder and components/InngestFunction
, they have to be imported through a nasty node_modules
direct import.
Since we can't fix tsc
here, it'd be nice to include these exports so a better workaround can be used.
Released in kbd>[inngest@3.4.3](https://github.com/inngest/inngest-js/releases/tag/inngest%403.4.3)</kbd.
Thanks for the thorough investigation and workaound, @MonsterDeveloper. 🙌
Describe the bug When enabling the
composite
in a project'stsconfig.json
, the compiler shows an error when usinginngest.createFunction
:To Reproduce Steps to reproduce the behavior:
inngest.createFunction
composite
intsconfig.json
Link to reproduction: CodeSandbox
Expected behavior Inngest library should be working within composite projects without errors.
Code snippets / Logs / Screenshots
System info (please complete the following information):
"inngest": "3.4.2"
"typescript": "^5.0.2"