RangeError: Maximum call stack size exceeded
See original GitHub issueBug Report
Hi All,
When I try to retrieve image from one URL and sending the response. I am getting the following error.
controller.file.ts
@Get("/:id/photo")
@Header("Content-Type", "image/png")
@ApiResponse({ status: HttpStatus.OK, description: "Get user photo" })
@ApiResponse({ status: HttpStatus.NOT_FOUND, description: "Not found" })
@ApiParam({ name: "id" })
async getUserPhoto(@Param() parameter, @Res() response): Promise<any> {
const result = await this.userService.getUserPhoto(parameter.id);
return result.data.pipe(response);
}
service.file.ts
async getUserPhoto(userId: string): Promise<AxiosResponse> {
try {
const URL = "https://example.com";
return await this.httpService.axiosRef({
url: `${URL }/photo/{userId}`,
method: "GET",
responseType: "stream",
});
} catch (error) {
throw new HttpException("Image Not Found", HttpStatus.NOT_FOUND);
}
}
This code was worked with
@nest/common - 6.8.3
I updated to @nest/common - 6.11.1
and getting the following error.
Error
RangeError: Maximum call stack size exceeded at baseClone (path\node_modules\lodash.clonedeep\index.js:841:19)
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at write_ (_http_outgoing.js:632:17)
at ServerResponse.write (_http_outgoing.js:624:15)
at IncomingMessage.ondata (_stream_readable.js:753:22)
at IncomingMessage.emit (events.js:219:5)
at IncomingMessage.EventEmitter.emit (domain.js:482:12)
at IncomingMessage.Readable.read (_stream_readable.js:553:10)
at flow (_stream_readable.js:1022:34)
at resume_ (_stream_readable.js:1003:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Please help me to solve this.
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@btd1337 that looks to be related to
nestjs-config
which is a community module, not managed by the core teamNest.js version: 7.6.15
If
winstonConfig
is insidesrc/config
this error occur:But if
winstonConfig
is inside any other folder insrc
the project is compiled normally.