forcedotcom / lwc-dev-server-feedback

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

Error compiling force/lds || rollup unresolved dependencies #67

Closed lukethacoder closed 4 years ago

lukethacoder commented 4 years ago

Describe the bug Throws Uncaught Error: Could not resolve entry (force/lds) when attempting to load the localserver.

To Reproduce Steps to reproduce the behavior:

  1. Run sfdx force:lightning:lwc:start
  2. Everything compiles nicely
  3. Open the browser to localhost:3333 is fires an Uncaught Error: Could not resolve entry (force/lds) both in the browser console (see screenshot) and in the terminal (see code below)

The rollup unresolved dependencies just look like warnings to me, and not too concerned if the wrappers around the local server aren't loading in.

Expected behavior LWC to render in the browser.

Screenshots & Code Snippets

image

C:\path-to-sfdx-project>sfdx force:lightning:lwc:start
Use of this plugin is subject to the Salesforce.com Program Agreement.
By installing this plugin, you agree to the Salesforce.com Program Agreement<https://trailblazer.me/terms>
and acknowledge the Salesforce Privacy Policy<https://www.salesforce.com/company/privacy.jsp>.

Starting LWC Local Development.
    Dev Hub Org: dev-org-user@force.com
    Scratch Org: test-abc@example.com
    Api Version: 49.0
Template version key 015016a1e6
[HPM] Proxy created: /  ->  https://enterprise-123-abc-dev-ed.cs46.my.salesforce.com
[HPM] Subscribed to http-proxy events:  [ 'proxyReq', 'error', 'close' ]
Server up on http://localhost:3333
Resolved 238 LWC modules in 2758 ms
[0] [rollup] 'lightning/breadcrumbs' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\preview\preview.html, but could not be resolved – treating it as an external dependency
[0] [rollup] 'lightning/breadcrumb' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\preview\preview.html, but could not be resolved – treating it as an external dependency
[0] [rollup] 'lightning/spinner' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\preview\preview.html, but could not be resolved – treating it as an external dependency
[view__preview.js] Done in 9225 ms
Writing C:\path-to-sfdx-project\.localdevserver/public/webruntime/view/3c6ea0269e/dev/en_US/preview.js...
[view__mainLayout.js] Done in 64 ms
Writing C:\path-to-sfdx-project\.localdevserver/public/webruntime/view/67133358b1/dev/en_US/mainLayout.js...
[lds] Done in 348 ms
Error: Error compiling force/lds
    at Proxy.compile (C:\Users\USER_NAME\AppData\Local\sfdx\node_modules\@webruntime\compiler\dist\commonjs\compiler\compiler.js:231:15)
Caused by: Error: Could not resolve entry (force/lds)
    at error (C:\Users\USER_NAME\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:3460:30)
    at C:\Users\USER_NAME\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:21359:17
[0] [rollup] 'lightning/verticalNavigation' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\componentsPanel\componentsPanel.html, but could not be resolved – treating it as an external dependency
[0] [rollup] 'lightning/verticalNavigationSection' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\componentsPanel\componentsPanel.html, but could not be resolved – treating it as an external dependency
[0] [rollup] 'lightning/verticalNavigationItemIcon' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\componentsPanel\componentsPanel.html, but could not be resolved – treating it as an external dependency
[0] [rollup] 'lightning/icon' is imported by ..\..\..\AppData\Local\sfdx\node_modules\@salesforce\lwc-dev-server\modules\localdevserver\resourcesPanel\resourcesPanel.html, but could not be resolved – treating it as an external dependency
[view__home.js] Done in 287 ms
Writing C:\path-to-sfdx-project\.localdevserver/public/webruntime/view/1e5430e952/dev/en_US/home.js...

Desktop:

Additional context

Is 49.0 supported by lwc-dev-server yet?

stale[bot] commented 4 years ago

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

git2gus[bot] commented 4 years ago

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

rajendrasnagar commented 4 years ago

Is this going to be fixed? @lukethacoder Do you found any workaround for this. I am also getting the same error. image

rajendrasnagar commented 4 years ago

Just checked further. It seems my sandbox is upgraded to newer release. I guess that has to do something with this issue. It seems to be related to https://github.com/forcedotcom/lwc-dev-server-feedback/issues/48 issue.

Local Dev Server: v1.0.10 Api Version: 49.0

It seems current version doesn't support v.49 yet.

Regards, Raj

lukethacoder commented 4 years ago

Was thinking it was an issue with the API version. Bit of a pain that the new release versions don't work out of the box with the dev server.

Any timeline on when 49.0 will be supported?

toppimb-abv commented 4 years ago

Our team is also blocked by this issue.

sfdx update and sfdx plugins:update have not helped.

It seems like the automatic updating of sandboxes renders the dev server unusable. It's a shame that we can't opt out of updates to the sandbox or have the dev server up to date with those releases.

Any estimate for an update would be appreciated!

Confirm4Crit commented 4 years ago

Doesn't seem like the prerelease version doesn't helpm either.

alide commented 4 years ago

We have the same problem since last weekend. The preview works fine for the dev hub which API version is still 48.0. But not working for our sandbox which API version is 49.0.

lovleshpokra commented 4 years ago

We are also facing a similar issue. I tried updating the dev server version as well but no success. It seems to break changes in API 49.0. Have anyone got a workaround for this issue? I'll post as soon as I get it. Thanks

danigonlinea commented 4 years ago

At the moment, to continue the work I have get back to API 48.0 which is working fine so let's wait until it gets compatible with newest version.

SFDX_API_VERSION=48.0 sfdx force:org:create ...

Also, I have to follow this steps to get back to work https://github.com/forcedotcom/lwc-dev-server-feedback/issues/47#issuecomment-574022181

lovleshpokra commented 4 years ago

I've got a workaround for resolving the issue. Installing 'lwc-dev-server' in the project repository worked for me.

npm i @salesforce/lwc-dev-server

PS: If you try to update the SFDX CLI for the solution, it will get reverted to the default at the time of authorization.

mikewgd commented 4 years ago

At the moment, to continue the work I have get back to API 48.0 which is working fine so let's wait until it gets compatible with newest version.

SFDX_API_VERSION=48.0 sfdx force:org:create ...

Also, I have to follow this steps to get back to work #47 (comment)

I tried do that sfdx force:config:set apiVersion=48.0 in my project and than ran those commands from that post but still getting an issue.

mikewgd commented 4 years ago

I've got a workaround for resolving the issue. Installing 'lwc-dev-server' in the project repository worked for me.

npm i @salesforce/lwc-dev-server

PS: If you try to update the SFDX CLI for the solution, it will get reverted to the default at the time of authorization.

This seems to work for me as well! I guess we will need to wait for a more permanent solution.

mikewgd commented 4 years ago

I've got a workaround for resolving the issue. Installing 'lwc-dev-server' in the project repository worked for me. npm i @salesforce/lwc-dev-server PS: If you try to update the SFDX CLI for the solution, it will get reverted to the default at the time of authorization.

This seems to work for me as well! I guess we will need to wait for a more permanent solution.

Although Im getting a new error now lds.getApexInvoker is not a function

mysticflute commented 4 years ago

Hi everyone, we're working now to get a fix for this out for those who are now on the next release.

stillbeingnick commented 4 years ago

I've got a workaround for resolving the issue. Installing 'lwc-dev-server' in the project repository worked for me. npm i @salesforce/lwc-dev-server PS: If you try to update the SFDX CLI for the solution, it will get reverted to the default at the time of authorization.

This seems to work for me as well! I guess we will need to wait for a more permanent solution.

Although Im getting a new error now lds.getApexInvoker is not a function

Same this seemed like it worked then it broke later down the call stack

mikewgd commented 4 years ago

@mysticflute Following up. Do you have an update on the resolution?

jag-j commented 4 years ago

Hello everyone, Please update the plugin to 2.1.0 for the fix. Thanks all for your patience.

toppimb-abv commented 4 years ago

Confirmed that running sfdx update does fix the issue.

thank you for the update!