Closed
Description
Package containing the bug
next-drupal (NPM package)
Describe the bug
In the /draft
entry point, the enableDraftMode()
function accepts a NextDrupal
object as its second parameter:
async function enableDraftMode(
request: NextRequest,
drupal: NextDrupal
): Promise<Response | never> {
enableDraftMode()
then uses that drupal
object's validateDraftUrl()
method.
That validateDraftUrl()
is actually a method of the NextDrupalBase
class, so theoretically a developer should be able to pass a NextDrupalBase
object to enableDraftMode()
and it should work. But the type definition of NextDrupal
prevents that; a TypeScript error is thrown during a TS build.
Expected behavior
A developer should be able to pass a NextDrupalBase
object to enableDraftMode()
and the TypeScript compilation should not fail and, when the code is run, draft mode should be enabled.