Getting "TypeError [ERR_INVALID_ARG_TYPE]: The "timeout" argument must be of type number. Received an instance of Object" when using "got"
See original GitHub issueWhen using msw on node for requests created by got I’ll get the following error.
at validateNumber (internal/validators.js:129:11)
at getTimerDuration (internal/timers.js:381:3)
at new ClientRequest (_http_client.js:170:20)
at request (http.js:50:10)
at Object.proxiedOriginalRequest (./node_modules/node-request-interceptor/src/interceptors/ClientRequest/index.ts:67:29)
at ClientRequestOverride.<anonymous> (./node_modules/node-request-interceptor/src/interceptors/ClientRequest/ClientRequestOverride.ts:268:15)
at step (./node_modules/node-request-interceptor/lib/interceptors/ClientRequest/ClientRequestOverride.js:33:23)
at Object.next (./node_modules/node-request-interceptor/lib/interceptors/ClientRequest/ClientRequestOverride.js:14:53)
at fulfilled (./node_modules/node-request-interceptor/lib/interceptors/ClientRequest/ClientRequestOverride.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
The initial requested created by me doesn’t even contain a timeout value. I’ve created a minimal repo to showcase the error: https://github.com/KnisterPeter/node-request-interceptor-with-got-issue
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Getting "TypeError [ERR_INVALID_ARG_TYPE]: The "timeout ...
Getting "TypeError [ERR_INVALID_ARG_TYPE]: The "timeout" argument must be of type number. Received an instance of Object" when using "got" #86.
Read more >TypeError [ERR_INVALID_ARG_TYPE] WHY IS THIS ...
I recreated your error. Your code is completely valid and works as long as you pass writeParams a valid Javascript object.
Read more >typeerror [err_invalid_arg_type]: the "data" argument must be ...
I try to use it with a simple tempate and I have got the error Quickadd : (error) TypeError [ERRINVALIDARG_TYPE]: the "data" argument...
Read more >Stream | Node.js v19.3.0 Documentation
Stream instances are switched into object mode using the objectMode option ... ServerResponse, which is a writable stream. let body = ''; //...
Read more >node-mssql | Microsoft SQL Server client for Node.js
server: 'localhost', // You can use 'localhost\\instance' to connect to named instance ... NOTE: To get number of rows affected by the statement(s), ......
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 FreeTop 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
Top GitHub Comments
@QuentinDejean, hey. This has already been released under
@mswjs/interceptors
. We have renamed the package because it no longer deals with Node.js interception exclusively. Migrate fromnode-request-interceptor
to the aforementioned package and you will have the fix.MSW users note: if you’re experiencing this issue in MSW, please await the next release that should happen this month. Thanks.
Hey @kettanaito , thanks for the update, great stuff! May I know when is the next release happening? We’d love to take advantage of this feature as soon as it’s done!