getResourceFromContext returns null result during build
See original GitHub issueI’m currently facing an issue while running & building my project. My Drupal backend is running as a container in an Azure Web App. Pages are generated within getStaticProps
.
const apiResource: JsonApiResource = await getResourceFromContext(type, context);
Type and context parameters are set correctly, but the result is always null. Below you’ll find an example output of some console.log statements
type
taxonomy_term--category
context
{
params: { slug: [ 'category', 'interviews' ] },
locales: undefined,
locale: undefined,
defaultLocale: undefined
}
apiResource
null
I use the code from above in a page named [...slug].tsx
When I run or build my NextJS project with a local Drupal backend, all contents are fetched and queried correctly.
Am I missing something in my NextJS configuration, when working with a remote backend or is the issue more related to my web app security and networking settings?
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top GitHub Comments
@kretzschr Since this bug came up a few times, I backported the fix and created a new release.
Can you upgrade to
next-drupal 1.4-rc1
and test please?Note: I’d still recommend the
DrupalClient
going forward.Thank you.
@kretzschr It looks like you’re hitting the same issue @Kroonax as mentioned here: https://github.com/chapter-three/next-drupal/issues/227#issuecomment-1152079200.
Is it possible to upgrade to the DrupalClient?
(I’ll also be patching this in the 1.4 release)