You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting started with solid, and wanted to create something similar but I have been struggling to get the createAgent.js file converted to typescript.
My current problem is:
const headers = {},
body = {},
opts = { method, headers, body };
if (data !== undefined) {
headers["Content-Type"] = "application/json";
opts.body = JSON.stringify(data);
}
But, headers["Content-type"] has this error, which I don't know how to fix, as u can't exactly get the headers type from the fetch api.
Element implicitly has an 'any' type because expression of type '"Content-Type"' can't be used to index type '{}'.
Property 'Content-Type' does not exist on type '{}'.
I know is kinda dumb but any help would be appreciated
The text was updated successfully, but these errors were encountered:
Getting started with solid, and wanted to create something similar but I have been struggling to get the createAgent.js file converted to typescript.
My current problem is:
const headers = {},
body = {},
opts = { method, headers, body };
if (data !== undefined) {
headers["Content-Type"] = "application/json";
opts.body = JSON.stringify(data);
}
But, headers["Content-type"] has this error, which I don't know how to fix, as u can't exactly get the headers type from the fetch api.
Element implicitly has an 'any' type because expression of type '"Content-Type"' can't be used to index type '{}'.
Property 'Content-Type' does not exist on type '{}'.
I know is kinda dumb but any help would be appreciated
The text was updated successfully, but these errors were encountered: