TypeError: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object
See original GitHub issueHi! Thanks for all the work you’ve put into this project. I’m following the quick start tutorial and have managed to set things up, after a some setbacks with simple_oauth library.
But, currently, I’m having an issue viewing my blog posts. I can see them at the home page and can also see that all their content is fetched in home page, as a collection. But once I visit a specific one (blog/first-post, as in blog/[node:title]), I get a 404 in the Network tab in Google Chrome.
And also this error.
1 of 1 unhandled error
Unhandled Runtime Error
Error: Failed to load script: /_next/static/chunks/pages/404.js
Source
.next\static\chunks\main.js (83:51) @ HTMLScriptElement.script.onerror
81 | // executes when `src` is set.
82 | script.onload = resolve;
> 83 | script.onerror = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)))
| ^
84 | ;
85 | // 2. Configure the cross-origin attribute before setting `src` in case the
86 | // browser begins to fetch.
I guess the following error is due to not getting any data in the response.
error - TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object
at Function.byteLength (buffer.js:726:11)
at ServerResponse.apiRes.end (C:\Users\trogl\Desktop\next-next-next\node_modules\next\dist\server\api-utils.js:72:41)
at C:\Users\trogl\Desktop\next-next-next\node_modules\next-drupal\dist\index.js:566:30
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Object.apiResolver (C:\Users\trogl\Desktop\next-next-next\node_modules\next\dist\server\api-utils.js:101:9)
at async DevServer.handleApiRequest (C:\Users\trogl\Desktop\next-next-next\node_modules\next\dist\server\next-server.js:770:9)
at async Object.fn (C:\Users\trogl\Desktop\next-next-next\node_modules\next\dist\server\next-server.js:661:37)
at async Router.execute (C:\Users\trogl\Desktop\next-next-next\node_modules\next\dist\server\router.js:205:32)
at async DevServer.run (C:\Users\trogl\Desktop\next-next-next\node_modules\next\dist\server\next-server.js:841:29) {
code: 'ERR_INVALID_ARG_TYPE',
page: '/api/preview'
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:29
Top Results From Across the Web
node.js - nodejs - first argument must be a string or Buffer
I'm simply trying to create a node server that outputs the HTTP status of a given URL. When I try to flush the...
Read more >The "string" argument must be one of type string, Buffer, or ...
I get the error: The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type object.
Read more >The first argument must be of type string or an instance of Buffer
TypeError: The "string " argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object comes...
Read more >ArrayBuffer - JavaScript - MDN Web Docs
Chrome Edge
ArrayBuffer Full support. Chrome7. Toggle history Full support. Edge12. Tog...
@@species Full support. Chrome51. Toggle history Full support. Edge13. Tog...
ArrayBuffer() constructor Full support....
Read more >Stream | Node.js v18 API
Stream instances are switched into object mode using the objectMode option ... For streams not operating in object mode, chunk must be a...
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
I am experiencing the same phenomenon.
The version I am using is as follows.
next-drupal: 0.16.2
next.js
(Drupal Module): 1.0.0-beta5I refer to this code, On the Drupal side, the page loaded successfully by applying the following patch to the subrequests module.
I faced the same issue (Drupal 9.2). As per @taku3202 comment, applying Drupal Subrequests patches solved it :