Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"error parsing or finding aura config: window.Aura not found" for all calls to custom Apex classes by LWCs #102

Open
JulianOstmo opened this issue Feb 12, 2021 · 6 comments

Comments

@JulianOstmo
Copy link

Describe the bug
When testing my LWCs in the Local Development Server, every call to a custom Apex class returns a 500 error with the following message: "error parsing or finding aura config: window.Aura not found". When the LWCs are pushed to my scratch org, they work perfectly.

To Reproduce
I am calling my custom Apex classes by using either the @wire decorator or as a function within a class method:

// force-app/main/default/lwc/MyComponent/MyComponent.js
import getCurrencies from "@salesforce/apex/CurrencyController.getCurrencies";

export default class myComponent extends LightningElement {
  activeCurrencies;

  @wire(getCurrencies)
  currencies({ data }) {
      this.activeCurrencies = data;
  }
}
// force-app/main/default/classes/CurrencyController.cls
public with sharing class CurrencyController {
  @AuraEnabled(cacheable=true)
  public static List<CurrencyType> getCurrencies() {
    return [
      SELECT IsoCode, toLabel(IsoCode) IsoLabel
      FROM CurrencyType
      WHERE IsActive = TRUE
    ];
  }
}
// force-app/main/default/lwc/OtherComponent/OtherComponent.js
import getCurrencies from "@salesforce/apex/CurrencyController.getCurrencies";

export default class otherComponent extends LightningElement {
  activeCurrencies;

  handleSearch() {
      getCurrencies().then((currencies) => {
        this.activeCurrencies = currencies;
      });
    }
  }
}

Screenshots
Screenshot 2021-02-12 at 11 20 19

Desktop (please complete the following information):

  • OS: macOS Catalina 10.15.7
  • Browser: chrome 88.0.4324.150
  • VS Code: v1.53.0
  • SFDX:
sfdx plugins --core@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.10.0
├─ @oclif/plugin-update 1.3.10
└─ @oclif/plugin-help 2.2.3
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.7 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 50.16.1 (core)
├─ limits 1.0.3 (core)
├─ user 1.0.11 (core)
├─ schema 1.0.3 (core)
├─ apex 0.1.4 (core)
├─ custom-metadata 1.0.11 (core)
├─ templates 50.4.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 50.16.1 (core)
sfdx-cli 7.86.3 (core)
telemetry 1.0.1 (core)

Additional context
I have:

  • ensured all my code is pushed to my scratch org
  • refreshed all SObject definitions
  • stopped and then started the local server
  • restarted VS Code
  • updated SFDX and plugins
@JulianOstmo
Copy link
Author

In my VSCode terminal, when loading an LWC component in the Local Development Server that calls a custom Apex class, I get this error:

TypeError: Cannot read property '_ownerDocument' of undefined
    at innerInvokeEventListeners (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:326:26)
    at invokeEventListeners (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:267:3)
    at EventTargetImpl._dispatch (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:214:9)
    at fireAnEvent (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/helpers/events.js:17:36)
    at /Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/browser/Window.js:608:7
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
TypeError: Cannot read property '_ownerDocument' of undefined
    at innerInvokeEventListeners (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:326:26)
    at invokeEventListeners (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:267:3)
    at EventTargetImpl._dispatch (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:214:9)
    at fireAnEvent (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/helpers/events.js:17:36)
    at /Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/browser/Window.js:608:7
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
Timed out waiting for initConfig
LWR6004: Server is shutdown
TypeError: Cannot read property '_ownerDocument' of undefined
    at innerInvokeEventListeners (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:326:26)
    at invokeEventListeners (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:267:3)
    at EventTargetImpl._dispatch (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:214:9)
    at fireAnEvent (/Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/living/helpers/events.js:17:36)
    at /Users/myaccount/.local/share/sfdx/node_modules/jsdom/lib/jsdom/browser/Window.js:608:7
    at processTicksAndRejections (internal/process/task_queues.js:79:11)

@stale
Copy link

stale bot commented Feb 27, 2021

This issue has been automatically marked as type:bug-p3 because it has not had recent activity.

@stale stale bot added the type:bug-p3 label Feb 27, 2021
@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-8943505

@stale stale bot removed the type:bug-p3 label Feb 27, 2021
@stale
Copy link

stale bot commented Mar 7, 2021

This issue has been automatically marked as type:bug-p3 because it has not had recent activity.

@stale stale bot added the type:bug-p3 label Mar 7, 2021
@jbelloperezSFDC
Copy link

Has this issue been resolved or is there any worked around? I am experiencing the same issue.

@stale stale bot removed the type:bug-p3 label Jun 23, 2023
@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as type:bug-p3 because it has not had recent activity.

@stale stale bot added the type:bug-p3 label Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants