forcedotcom / lwc-dev-server-feedback

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

LWC server errors on start with Unable to expose method "then" #82

Closed CatJazz closed 3 years ago

CatJazz commented 3 years ago

Am I doing something wrong? This was working for me several months ago.

  1. node --version v12.18.3

  2. sfdx update sfdx-cli: Updating CLI... already on latest version: 7.75.0-5521f40d11 warning "@salesforce/lwc-dev-server > @rollup/plugin-alias@3.1.1" has unmet peer dependency "rollup@^1.20.0||^2.0.0". warning "@salesforce/lwc-dev-server > request-promise-native@1.0.8" has unmet peer dependency "request@^2.34". warning "@salesforce/lwc-dev-server > request-promise-native > request-promise-core@1.1.3" has unmet peer dependency "request@^2.34". sfdx-cli: Updating plugins... done sfdx plugins @salesforce/lwc-dev-server 2.5.1 ├─ @oclif/plugin-help 2.2.1 └─ @oclif/plugin-update 1.3.9 salesforcedx 49.13.0 ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 ├─ templates 49.10.0 ├─ custom-metadata 1.0.10 ├─ salesforce-alm 49.12.1 └─ apex 0.1.0

  3. sfdx force:lightning:lwc:start Error: Unable to expose method "then"

stale[bot] commented 3 years ago

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

git2gus[bot] commented 3 years ago

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

xyc commented 3 years ago

@CatJazz Could you try the following workarounds?

  1. Uninstalled local dev plugins & re-install it. If you are using npm based cli, try the standalone executable.
  2. Try starting local dev server with SFDX_LAZY_LOAD_MODULES=false flag: SFDX_LAZY_LOAD_MODULES=false sfdx force:lightning:lwc:start
stale[bot] commented 3 years ago

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

CatJazz commented 3 years ago

I tried @xyc but still get same error.

stale[bot] commented 3 years ago

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

Chris-James commented 3 years ago

While attempting to follow these instructions I received the same error:

$ sfdx force:lightning:lwc:start
    Error: Unable to expose method "then"

However, in my case, setting SFDX_LAZY_LOAD_MODULES false as per @xyc's comment worked:

$ SFDX_LAZY_LOAD_MODULES=false sfdx force:lightning:lwc:start

Starting LWC Local Development.
    Dev Hub Org: <...>
    Scratch Org: <...>
    Api Version: 50.0

I installed v2.5.1.

CatJazz commented 3 years ago

Thanks @Chris-James. It is working now for me. Issue was my scratch org was expired, but I still got the same error as you. Only if I tried running command in a bash shell did I get a warning about the invalid scratch org.