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 middleware runtime not supported #717

Open
davidwinter opened this issue Nov 4, 2023 · 4 comments
Open

Next.js middleware runtime not supported #717

davidwinter opened this issue Nov 4, 2023 · 4 comments

Comments

@davidwinter
Copy link

It doesn't seem as though bunyan supports the Node.js middleware runtime. It's a bit of a quirky one, as it's not Node.js nor a strict browser environment.

https://nextjs.org/docs/pages/api-reference/edge

It should be fine, if it is detectable somehow, for the middleware edge runtime to just use the browser version.

@davidwinter
Copy link
Author

davidwinter commented Nov 4, 2023

Can we change this line to check for global or globalThis instead of just window?

https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js#L55

Though in fact, window still doesn't exist on globalThis in the middleware as it's an edge runtime.

@PauMateu
Copy link

Hi, we are facing the same issue, any news on how to solve this?

@rgembalik
Copy link

Same problem here - I would love to see some way of actually overriding the environment, or detect next as a separate one.

@chris-aeviator
Copy link

this seems to be a common theme pinojs/pino#1909

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

4 participants