Skip to main content
added 7 characters in body
Source Link

I had an apex method with @AuraEnabled(cacheable=true)@AuraEnabled(cacheable=true) and a wire method in LWC, all was working fine.

Then to meet the new requirement I was experimenting with @AuraEnabled(cacheable=false)@AuraEnabled(cacheable=false). With this config the LWC refused to run the apex method with this error:

{
    "status": 500,
    "body": {
        "message": "Apex methods that are to be cached must be marked as @AuraEnabled(cacheable=true)"
    },
    "headers": {}
}

I set it back to (cacheable=true)(cacheable=true) but the 500 error is still appearing, I tried hard refresh, closing the browser but it doesn't not help.

What can I do to get the original behaviourbehavior back?

I had an apex method with @AuraEnabled(cacheable=true) and a wire method in LWC, all was working fine.

Then to meet the new requirement I was experimenting with @AuraEnabled(cacheable=false). With this config the LWC refused to run the apex method with this error:

{
    "status": 500,
    "body": {
        "message": "Apex methods that are to be cached must be marked as @AuraEnabled(cacheable=true)"
    },
    "headers": {}
}

I set it back to (cacheable=true) but the 500 error is still appearing, I tried hard refresh, closing the browser but it doesn't not help.

What can I do to get the original behaviour back?

I had an apex method with @AuraEnabled(cacheable=true) and a wire method in LWC, all was working fine.

Then to meet the new requirement I was experimenting with @AuraEnabled(cacheable=false). With this config the LWC refused to run the apex method with this error:

{
    "status": 500,
    "body": {
        "message": "Apex methods that are to be cached must be marked as @AuraEnabled(cacheable=true)"
    },
    "headers": {}
}

I set it back to (cacheable=true) but the 500 error is still appearing, I tried hard refresh, closing the browser but it doesn't not help.

What can I do to get the original behavior back?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link
Anton Solomin
  • 147
  • 1
  • 3
  • 8

Issue with @AuraEnabled(cacheable=true)

I had an apex method with @AuraEnabled(cacheable=true) and a wire method in LWC, all was working fine.

Then to meet the new requirement I was experimenting with @AuraEnabled(cacheable=false). With this config the LWC refused to run the apex method with this error:

{
    "status": 500,
    "body": {
        "message": "Apex methods that are to be cached must be marked as @AuraEnabled(cacheable=true)"
    },
    "headers": {}
}

I set it back to (cacheable=true) but the 500 error is still appearing, I tried hard refresh, closing the browser but it doesn't not help.

What can I do to get the original behaviour back?