Open
Description
const node = await getResourceFromContext("node--article", {
params: {
"fields[node--article]": "title"
}
})
The code above (on a Drupal site with translation enabled) will return null because of the bug here:
next-drupal/packages/next-drupal/src/get-resource.ts
Lines 59 to 67 in 4022f62
Solution: Always include default_langcode
for the resource (until this is resolved in decoupled_router).
const node = await getResourceFromContext("node--article", {
params: {
"fields[node--article]": "title,default_langcode"
}
})