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
The analyze.js file at kit/src/core/postbuild is not populating any of the api methods of routes. This means the builder in the adapt method of adapters are getting incorrect metadata about routes.
mod is going to have GET as the key, and the function as the value, but the foreach is being run on Object.values(mod) instead of Object.keys(mod). This means that the method variable is a function instead of the name of the HTTP action and mod[method] && ENDPOINT_METHODS.has(method) will always evaluate to false. Object.values needs to be Object.keys.
Reproduction
Create a route that's got a +server.ts in it that exports just a GET function
Put a console.log(JSON.stringify(builder)) in the adapt method of an adapter.
Observe the routes in the output of the builder log does not have 'GET' in methods or api.methods
Describe the bug
The analyze.js file at
kit/src/core/postbuild
is not populating any of the api methods of routes. This means the builder in theadapt
method of adapters are getting incorrect metadata about routes.The incorrect block of code is here (link):
mod
is going to haveGET
as the key, and the function as the value, but the foreach is being run onObject.values(mod)
instead ofObject.keys(mod)
. This means that themethod
variable is a function instead of the name of the HTTP action andmod[method] && ENDPOINT_METHODS.has(method)
will always evaluate to false.Object.values
needs to beObject.keys
.Reproduction
console.log(JSON.stringify(builder))
in theadapt
method of an adapter.routes
in the output of the builder log does not have 'GET' inmethods
orapi.methods
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: