Skip to content

Archived content results in a 500 response in Next.js #864

@cruno91

Description

@cruno91

Package containing the bug

next-drupal (NPM package)

Describe the bug

When archiving content in Drupal with workflows, the content in Next.js returns a 500 response after revalidation.

Expected behavior

Archived content returns a 404 response in Next.js

Steps to reproduce:

  1. First create a page in Drupal and publish it
  2. Then navigate to the page in Next.js
  3. You will see the published content (200 response)
  4. Then archive the page in Drupal
  5. Then navigate to the page in Next.js
  6. You will see a 500 response

Additional context

 ⨯ _JsonApiErrors: Access denied for entity.
    at NextDrupalPages.throwIfJsonErrors (file:///app/node_modules/next-drupal/dist/index.js:367:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextDrupalPages.translatePath (file:///app/node_modules/next-drupal/dist/index.js:785:5)
    at async NextDrupalPages.translatePathFromContext (file:///app/node_modules/next-drupal/dist/index.js:1048:12)
    at async h (/app/apps/www-municipal/.next/server/pages/[...slug].js:1:1658)
    at async e3 (/app/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js:25:3930)
    at async doRender (/app/node_modules/next/dist/server/base-server.js:1414:30)
    at async cacheEntry.responseCache.get.routeKind (/app/node_modules/next/dist/server/base-server.js:1588:28)
    at async /app/node_modules/next/dist/server/response-cache/index.js:90:36
    at async /app/node_modules/next/dist/lib/batcher.js:45:32 {
  errors: 'Access denied for entity.',
  statusCode: 403

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageA new issue that needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions