forcedotcom / lwc-dev-server-feedback

LWC Local Development
BSD 3-Clause "New" or "Revised" License
45 stars 10 forks source link

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

Open JulianOstmo opened 3 years ago

JulianOstmo commented 3 years ago

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):

Additional context I have:

JulianOstmo commented 3 years ago

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[bot] commented 3 years ago

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

uip-robot-zz commented 3 years ago

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

stale[bot] commented 3 years ago

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

jbelloperezSFDC commented 1 year ago

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

stale[bot] commented 1 year ago

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