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.

Error: JSON:API does not yet support resource versioning for this resource type.

See original GitHub issue

Some Drupal resources do not support revisions such as taxonomy terms (at least in 8.9.6). Hence JSON:API will complain when resourceVersion is provided, even if it’s set to rel:latest-version unfortunately:

Error: JSON:API does not yet support resource versioning for this resource type. For context, see https://www.drupal.org/project/drupal/issues/2992833#comment-12818258. To contribute, see https://www.drupal.org/project/drupal/issues/2350939 and https://www.drupal.org/project/drupal/issues/2809177.
    at /Users/cali/src/webshop-next/node_modules/next-drupal/dist/index.js:478:19
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async getStaticProps (webpack-internal:///./pages/[...slug].tsx:92:16)
    at async Object.renderToHTML (/Users/cali/src/webshop-next/node_modules/next/dist/server/render.js:329:24)
    at async doRender (/Users/cali/src/webshop-next/node_modules/next/dist/server/next-server.js:1144:38)
    at async /Users/cali/src/webshop-next/node_modules/next/dist/server/next-server.js:1236:28
    at async /Users/cali/src/webshop-next/node_modules/next/dist/server/response-cache.js:64:36 {
  page: '/[...slug]'
}

This is an issue when using getResourceByPath(). Is there a reason it’s explicitly specifying resourceVersion=rel:latest-version by default?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Phaultcommented, Oct 18, 2021

Hi again,

Oh wow, I didn’t expect such a quick turnaround. I’ve finally gotten around to testing it and it appears to be working great. Thanks a lot. 🙏

1reaction
shadcncommented, Oct 10, 2021

hmm you’re right. This needs a fix. I’ll look into it. Thanks for reporting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a version negotiation to revisionable resource types
Create a Drupal plugin that will provide the negotiation of revision id values using data submitted to a json api route in a...
Read more >
Allow use of version in Accept Header · Issue #874 - GitHub
I'm approaching the versioning from the standpoint that a server will support multiple versions simultaneously. In JR this is easily done with ...
Read more >
cerebris/jsonapi-resources - Gitter
Hi, I'm starting to use jsonapi-resources however, I'm stuck while testing with rspec requests. Is there any easy way to generate json-api resources...
Read more >
JSON:API — Latest Specification (v1.1)
Latest Specification (v1.1). Status. This page presents the latest published version of JSON:API, which is currently version 1.1.
Read more >
RESTful web API design - Best Practices - Microsoft Learn
REST APIs are designed around resources, which are any kind of object, data, or service that can be accessed by the client. A...
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