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

Next.js basePath breaks registration #321

Open
jpwilliams opened this issue Sep 21, 2023 · 0 comments
Open

Next.js basePath breaks registration #321

jpwilliams opened this issue Sep 21, 2023 · 0 comments
Labels
Bug Something isn't working 📦 inngest Affects the `inngest` package

Comments

@jpwilliams
Copy link
Member

Describe the bug

When using basePath in a next.config.js file, the "inngest/next" serve handler doesn't detect the correct URL.

To Reproduce

  1. Add basePath: "/example" to examples/framework-nextjs/next.config.js
  2. Run pnpm run dev:example --example framework-nextjs
  3. Run npx inngest-cli@latest dev
  4. In the dev server UI, add http://localhost:3000/example/api/inngest

Expected behavior

The app should correctly register, but instead fails.

The reported URL from the app is still http://localhost:3000/api/inngest (missing the /example prefix), so the dev server also erroneously displays both that and the prefixed URL.

It looks as though Next.js gives us little

Code snippets / Logs / Screenshots

[inngest] reporting URL as: {
  href: 'http://localhost:3000/api/inngest',
  __NEXT_ROUTER_BASEPATH: undefined,
  __NEXT_MANUAL_CLIENT_BASE_PATH: undefined
}

image

System info:

System:
  OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
  CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600K
  Memory: 10.87 GB / 15.53 GB
  Container: Yes
  Shell: 5.0.17 - /bin/bash
Binaries:
  Node: 18.12.1 - ~/.volta/tools/image/node/18.12.1/bin/node
  Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
  npm: 9.6.4 - ~/.volta/tools/image/npm/9.6.4/bin/npm
@jpwilliams jpwilliams added the Bug Something isn't working label Sep 21, 2023
@jpwilliams jpwilliams added the 📦 inngest Affects the `inngest` package label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working 📦 inngest Affects the `inngest` package
Projects
None yet
Development

No branches or pull requests

1 participant