Following the Get Started guide on a clean Drupal 10 install fails to resolve
See original GitHub issueWhen 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.
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:
- Created 9 months ago
- Comments:8
Top GitHub Comments
Hmm I see. I’ll improve the docs for it https://next-drupal.org/docs/environment-variables#required
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!