How do I eliminate or work around a 500 error preventing me from using Lightning components on a VisualForce page in a sandbox? Identical code works in a dev org but fails in a sandbox.

Note: In the sandbox I used, the "My Domain" feature is in a "Ready for Testing but Hidden from Users" state, whereas in the dev org I used, the "My Domain" feature is in a fully deployed state.

Only mentioning My Domain for good measure, since this document says:

Finally, you don’t need to enable My Domain to use Lightning components in the following contexts.

  • Lightning components with Communities in Community Builder
  • Lightning Components for Visualforce

Copious details below.


Sample code taken verbatim from Lightning Components Developer Guide.


<aura:application access="GLOBAL" extends="ltng:outApp"> 
    <aura:dependency resource="ui:button"/>


<apex:page >
    <apex:includeLightning />

    <div id="lightning" />

        $Lightning.use("c:lcvfTest", function() {
          { label : "Press Me!" },
          function(cmp) {
            // do some stuff


Dev org succeeded but Sandbox failed.

Dev Org

Renders a button, just as described in the documentation.

Sandbox Org

No Button is rendered. The browser's debug console reveals a request which fails with a 500 error.

(Note: In the following output, hash-like values in the "loaded" object were replaced with fictitious ones, since I do not know whether the hashes contain private information. Custom domain values are also fictitious. The "fwid" values are not fictitious.)

The URL of the request which triggered a 500 error was:


Opening this URL in its own browser tab yields the following content (indentation added by me):

    "event": {
        "eventDef": {
            "v": {
                "superDef": {
                    "v": {
    "defaultHandler":"function() {$A.clientService.setOutdated()}"

The large URL-encoded portion of the URL above decodes to this (indentation added by me):


Environments Tested

Attempted some additional setups other than those above. Here is a full list of environments tested (including the above), with results:

  1. Failed: A Sandbox (on cs2) for a Summer 2016 Enterprise org, created before June 11. My Domain in a Testing phase of deployment.
  2. Failed: Another Sandbox (on cs44) for org #1, created on July 19. My Domain in a testing phase of deployment.
  3. Succeeded: A Developer Edition org. My Domain fully deployed.
  4. Succeeded: Another Developer Edition org. My Domain fully deployed.
  5. Succeeded: A sandbox for an Unlimited Edition org, unrelated to org #1 and created before June 11. My Domain fully deployed.

Possible Stack Trace

While I do not know how to access a server-side exception log for the Aura framework, I have attempted to piece together a stack trace by manually inspecting the Aura source code from github. The result of my attempt is as follows:

  1. AuraResourceServlet.doGet: Line 124
  2. TemplateResource.write: Line 68
  3. TemplateResource.internalWrite: Line 87
  4. DefinitionServiceImpl.updateLoaded: Line 209
  • Determined that "fwid" does not contain personal information but a hash of all javascript in the framework. Thus, replaced the fictional value in this post with the real value. In the process, decided that this code in the framework looks suspect. – quietopus Jul 20 '16 at 4:22
  • Error seems to originate from here, although I know of no way to verify that this is indeed the ClientOutOfSyncException being thrown. If I follow the code correctly, it may have something to do with the MasterDefRegistryImpl having the wrong uid for the APPLICATION. – quietopus Jul 20 '16 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.