question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Following the Get Started guide on a clean Drupal 10 install fails to resolve

See original GitHub issue

When following the Get Started guide I’m able to get through everything until Start Development Server. The server starts, but if I navigate to the next site, I get an error.

Screenshot 2022-12-16 at 9 55 36 PM

With debug enabled, this is the output from the next server:

wait  - compiling / (client and server)...
event - compiled client and server successfully in 153 ms (246 modules)
[next-drupal][debug]: Debug mode is on.
[next-drupal][debug]: Using default fetch (polyfilled by Next.js).
[next-drupal][debug]: Fetching resource collection of type node--article
[next-drupal][debug]: https://decoupled.lndo.site/jsonapi/node/article?filter%5Bstatus%5D=1&fields%5Bnode--article%5D=title%2Cpath%2Cfield_image%2Cuid%2Ccreated&include=field_image%2Cuid&sort=-created
[next-drupal][debug]: Using default fetch (polyfilled by Next.js).
error - JsonApiErrors: 400 Bad Request
Input value "fields" contains a non-scalar value.
    at /app/next/node_modules/next-drupal/dist/index.js:2550:19
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getStaticProps (webpack-internal:///./pages/index.tsx:97:19)
    at async Object.renderToHTML (/app/next/node_modules/next/dist/server/render.js:385:20)
    at async doRender (/app/next/node_modules/next/dist/server/base-server.js:720:34)
    at async cacheEntry.responseCache.get.incrementalCache.incrementalCache (/app/next/node_modules/next/dist/server/base-server.js:828:28)
    at async /app/next/node_modules/next/dist/server/response-cache/index.js:83:36 {
  errors: [
    {
      title: 'Bad Request',
      status: '400',
      detail: 'Input value "fields" contains a non-scalar value.',
      links: [Object]
    }
  ],
  statusCode: 400,
  page: '/'
}
wait  - compiling /_error (client and server)...
event - compiled client and server successfully in 52 ms (247 modules)

Navigating to the URL next is trying to retrieve data (https://decoupled.lndo.site/jsonapi/node/article?filter%5Bstatus%5D=1&fields%5Bnode--article%5D=title%2Cpath%2Cfield_image%2Cuid%2Ccreated&include=field_image%2Cuid&sort=-created) from results in that 400 response as well.

If i try to navigate to the same path without the URL parameters (https://decoupled.lndo.site/jsonapi/node/article) I get data back from Drupal (200 response).

Quick note on patches:

The ones defined in the Apply patches section are outdated. The patch listed for decoupled_router does not apply.

This is what I’ve updated with:

        "patches": {
            "drupal/subrequests": {
                "3049395-47 Get same results on different request": "https://www.drupal.org/files/issues/2022-12-06/subrequests-3049395-chnage-request-type-47.patch"
            },
            "drupal/decoupled_router": {
                "3111456-59 Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2022-12-01/decouple_router-3111456-resolve-language-issue-58--get-translation.patch"
            }
        }

Drupal: 10 Nextjs module: 1.6.1 next drupal starter: 1.7.2 Node: v16.19.0

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
shadcncommented, Dec 21, 2022

Hmm I see. I’ll improve the docs for it https://next-drupal.org/docs/environment-variables#required

0reactions
cruno91commented, Dec 21, 2022

Ah yes I understand now. NEXT_IMAGE_DOMAIN is literally for the images of the site. I thought that variable was for the next site itself.

It’s working now, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Drupal 'Clean URLs' problems | Troubleshooting Drupal
In Drupal, clean URLs are enabled by default and can't be disabled. However, a rewrite module must be installed on your web server....
Read more >
Troubleshoot installation problems | Drupal.org
The installation script cannot connect to the database. Check if the username, password and hostname that you provided are correct. Cannot ...
Read more >
Broken site problems | Troubleshooting Drupal
Run the update script, and 'Clear all caches'. When a site is acting strangely, or displays bizarre errors, or displays a blank page, ......
Read more >
Solved: Error on install of Drupal 8
= Requirements - All fine after my previous code (chown/chmod), except for clean URLs, I play with .htaccess file but no matter what...
Read more >
Unable to install Drupal on Windows [#2275499]
Drupal starts to install modules. It gets to step where module name is not shown on "Installing Drupal" screen - step 7 of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found