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

Compatibility with NextJS Route Handlers #6

Open
ycouble opened this issue Jul 5, 2024 · 1 comment
Open

Compatibility with NextJS Route Handlers #6

ycouble opened this issue Jul 5, 2024 · 1 comment

Comments

@ycouble
Copy link
Collaborator

ycouble commented Jul 5, 2024

Currently it is not possible to use ecologits.js from within NextJS route handlers in the app router.

Haven't tried with the page router, but might be the same issue.

Some digging already done:

  • Using the instrumentation.ts file
  • Dynamic imports of openai or any
  • Demo repo
    • main branch : directly in route handler
    • instrumentation.ts branch : in instrumentation.ts
  • Using a commonJS target
  • Using import-in-the-middle instead of require-in-the-middle
  • Using a middleware
@ycouble
Copy link
Collaborator Author

ycouble commented Jul 18, 2024

Need to test with refacto implementation in #7 which no longer depends on require-in-the-middle, hence no more hook problems

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

1 participant