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

Error: GENSYNC_EXPECTED_START #296

Open
laduniestu opened this issue Jan 11, 2025 · 4 comments
Open

Error: GENSYNC_EXPECTED_START #296

laduniestu opened this issue Jan 11, 2025 · 4 comments

Comments

@laduniestu
Copy link

Node.js v20.18.0

"jiti": "^2.4.2",
"next": "15.1.4",
"@t3-oss/env-nextjs": "^0.11.1",

src/env/server.ts

import { z } from "zod";

export const envServer = createEnv({
  server: {
    PLUNK_API_KEY: z.string().url(),
    EMAIL_TO: z.string().min(1),
  },
  experimental__runtimeEnv: process.env,
});

next.config.ts

import { fileURLToPath } from "url";
import createJiti from "jiti";
const jiti = createJiti(fileURLToPath(import.meta.url));

async function loadEnv() {
  await jiti.import("./src/env/server.ts");
}

loadEnv().catch(e => {
  console.error(e);
  process.exit(1);
});

const nextConfig: NextConfig = {
  output: "standalone",
};

export default nextConfig;

Error :

Error: GENSYNC_EXPECTED_START: Got unexpected yielded value in gensync generator: undefined. Did you perhaps mean to use 'yield*' instead of 'yield'? 
/src/env/server.ts:0:0
    at <unknown> (src/env/server.ts:0:0)
@raikusy
Copy link

raikusy commented Jan 19, 2025

Same issue! found any solution?

@laduniestu
Copy link
Author

Same issue! found any solution?

not yet

@JulianKingman
Copy link

I was just making a repro of another issue when I encountered this one instead :)

@JulianKingman
Copy link

Reverting to a lower jiti version solved it:

"jiti": "^1.21.7",

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

No branches or pull requests

3 participants