fastify / fastify-request-context

Request-scoped storage support, based on Asynchronous Local Storage (with fallback to cls-hooked)
MIT License
153 stars 13 forks source link

CI seems to be failing #175

Closed mcollina closed 9 months ago

mcollina commented 9 months ago

Can somebody take a look?

Eomm commented 9 months ago

It is related to: https://github.com/fastify/fastify/pull/5056

Since we don't return anymore the content-type, when we execute .json()

https://github.com/fastify/fastify-request-context/blob/3925901f4e041281f75da40dd4c6cb2bdc08fc84/test/requestContextPlugin.spec.js#L61

It triggers and error

https://github.com/fastify/light-my-request/blob/a74e716656f366ea7743a10433116cbbefff6dd7/lib/response.js#L143

> JSON.parse('')
Uncaught SyntaxError: Unexpected end of JSON input

We need to update our test suite

shawshankkumar commented 9 months ago

It is related to: fastify/fastify#5056

Since we don't return anymore the content-type, when we execute .json()

https://github.com/fastify/fastify-request-context/blob/3925901f4e041281f75da40dd4c6cb2bdc08fc84/test/requestContextPlugin.spec.js#L61

It triggers and error

https://github.com/fastify/light-my-request/blob/a74e716656f366ea7743a10433116cbbefff6dd7/lib/response.js#L143

> JSON.parse('')
Uncaught SyntaxError: Unexpected end of JSON input

We need to update our test suite

Hi @Eomm ! Attempting to do this. Will make a draft pr once I figure it out, is that fine? Thanks!

update: made a pr https://github.com/fastify/fastify-request-context/pull/176

alfonsograziano commented 9 months ago

@shawshankkumar I found a solution but the linting is failing for me. Do you have the same issue? I'm getting 'use strict' is unnecessary inside of modules

shawshankkumar commented 9 months ago

@shawshankkumar I found a solution but the linting is failing for me. Do you have the same issue? I'm getting 'use strict' is unnecessary inside of modules

hey @alfonsograziano no, i am not getting any such errors, can you post a screenshot?