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

[BUG] ingest-cli doesn't register / sync nextjs server locally #545

Open
ziyaaktas opened this issue Apr 18, 2024 · 2 comments
Open

[BUG] ingest-cli doesn't register / sync nextjs server locally #545

ziyaaktas opened this issue Apr 18, 2024 · 2 comments

Comments

@ziyaaktas
Copy link

ziyaaktas commented Apr 18, 2024

Describe the bug
I have been going through the guides just to try out the ingest product. However I couldn't pass the syncing apps part.

To Reproduce
Go through the https://www.inngest.com/docs/quick-start tutorial.

Expected behavior
Local server syncs with nextjs

Code snippets / Logs / Screenshots
route.ts

import { serve } from 'inngest/next';
import { inngest } from '@/utils/inngest/client';
import { getContractData } from '@/utils/inngest/functions';

// Create an API that serves zero functions
export const { GET, POST, PUT } = serve({
  client: inngest,
  functions: [
    getContractData,
    /* your functions will be passed here later! */
  ],
});

When I ping localhost:3000/api/inngest, I get this response
{"message":"Inngest endpoint configured correctly.","hasEventKey":false,"hasSigningKey":false,"functionsFound":1,"mode":{"type":"dev","isExplicit":true}}

System info (please complete the following information):

  • OS: [e.g. Mac, Windows] Mac
  • npm package Version 10.2.4
  • Nextjs 14.2.1
  • Platform local at the moment

Additional context
Add any other context about the problem here.

image

Copy link

linear bot commented Apr 18, 2024

@chaejung-kim
Copy link

Have you checked middleware.ts? I had the same issue locally. Then I figured out middleware.ts was bypassing all routes including api/inngest. So, I added api/inngest to the matcher.

  • middleware.ts
// AS-IS
import { auth } from "@providers/auth";

export default auth((req) => {
  // some logic like authentication
});

export const config = {
  matcher: ["/((?!_next|api/auth|logo.svg|favicon.ico).*)"],
};
// TO-BE
import { auth } from "@providers/auth";

export default auth((req) => {
  // some logic like authentication
});

export const config = {
  matcher: ["/((?!_next|api/auth|api/inngest|logo.svg|favicon.ico).*)"],
};

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

2 participants