forcedotcom / lwc-dev-server-feedback

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

Local dev server error with API version 48 #47

Closed Mr-Liquid closed 4 years ago

Mr-Liquid commented 4 years ago

Describe the bug Few days ago Local development server stopped working. Now when you try to run it locally you will get an error bellow.

Could you please check it out? Maybe it's related to new api version (48)

To Reproduce Steps to reproduce the behavior:

  1. run local server sfdx force:lightning:lwc:start
  2. See error: Error: Error compiling force/lds at Proxy.compile (/Users/ivan/.local/share/sfdx/node_modules/@webruntime/compiler/dist/commonjs/compiler/compiler.js:231:15) Caused by: Error: Could not resolve entry (force/lds) at error (/Users/ivan/.local/share/sfdx/node_modules/rollup/dist/rollup.js:3460:30) at /Users/ivan/.local/share/sfdx/node_modules/rollup/dist/rollup.js:21359:17 at async Promise.all (index 0) at async Proxy.compile (/Users/ivan/.local/share/sfdx/node_modules/@webruntime/compiler/dist/commonjs/compiler/compiler.js:202:24) at async Promise.all (index 0) at async FileSystemResourceProvider.get (/Users/ivan/.local/share/sfdx/node_modules/@webruntime/compiler/dist/commonjs/resources/filesystem-resource-provider.js:49:32) at async webruntimeResources (/Users/ivan/.local/share/sfdx/node_modules/@webruntime/compiler/dist/commonjs/server/resource-middleware.js:37:36)

Expected behavior Should run local server without any errors

Triopticon commented 4 years ago

I have the same problem with api 48 and sandbox in Spring 20!

Error: Error compiling force/lds
    at Proxy.compile (/Users/kennethsorensen/.local/share/sfdx/node_modules/@webruntime/compiler/dist/commonjs/compiler/compiler.js:231:15)
Caused by: Error: Could not resolve entry (force/lds)
    at error (/Users/kennethsorensen/.local/share/sfdx/node_modules/rollup/dist/rollup.js:3460:30)
    at /Users/kennethsorensen/.local/share/sfdx/node_modules/rollup/dist/rollup.js:21359:17

Full:

[0] [rollup] 'lightning/spinner' is imported by ../../../../.local/share/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 ../../../../.local/share/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/breadcrumbs' is imported by ../../../../.local/share/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 4731 ms
Writing /Users/kennethsorensen/source/repos/Xeneta/LockOpportunityRecordOnClose/.localdevserver/public/webruntime/view/8317de4485/dev/en_US/preview.js...
[view__mainLayout.js] Done in 103 ms
Writing /Users/kennethsorensen/source/repos/Xeneta/LockOpportunityRecordOnClose/.localdevserver/public/webruntime/view/67133358b1/dev/en_US/mainLayout.js...
[lds] Done in 417 ms
Error: Error compiling force/lds
    at Proxy.compile (/Users/kennethsorensen/.local/share/sfdx/node_modules/@webruntime/compiler/dist/commonjs/compiler/compiler.js:231:15)
Caused by: Error: Could not resolve entry (force/lds)
    at error (/Users/kennethsorensen/.local/share/sfdx/node_modules/rollup/dist/rollup.js:3460:30)
    at /Users/kennethsorensen/.local/share/sfdx/node_modules/rollup/dist/rollup.js:21359:17
[0] [rollup] 'lightning/verticalNavigation' is imported by ../../../../.local/share/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 ../../../../.local/share/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 ../../../../.local/share/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 ../../../../.local/share/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 281 ms
Writing /Users/kennethsorensen/source/repos/Xeneta/LockOpportunityRecordOnClose/.localdevserver/public/webruntime/view/eaf2cb0c78/dev/en_US/home.js...

And the console info:

Uncaught Error: Could not resolve entry (force/lds)
    at error (:3333/Users/kennethsorensen/.local/share/sfdx/node_modules/rollup/dist/rollup.js:3460)
    at :3333/Users/kennethsorensen/.local/share/sfdx/node_modules/rollup/dist/rollup.js:21359

utils.js:7 Uncaught (in promise) Error: Cannot resolve dependency 'lightning/verticalNavigationSection'
    at assert$1 (utils.js:7)
    at Object.assign.__circular__ (moduleRegistry.js:161)
    at resolveCircularModuleDependency (engine.js:738)
    at c (engine.js:3432)
    at tmpl$1 (home.js:240)
    at evaluateTemplate (engine.js:4057)
    at engine.js:4228
    at runWithBoundaryProtection (engine.js:6106)
    at invokeComponentRenderMethod (engine.js:4218)
    at renderComponent (engine.js:4357)
jastend commented 4 years ago

Same issue since my sandbox has been upgraded to API version 48.0. Everything works when testing with another sandbox that's still using API version 47.0.

Starting LWC Local Development.
    Dev Hub Org: undefined
    Scratch Org: jastend@xx.com.cs
    Api Version: 48.0
Template version key 55cfaf2e80
[HPM] Proxy created: /  ->  https://xx--cs.my.salesforce.com
[HPM] Subscribed to http-proxy events:  [ 'proxyReq', 'error', 'close' ]
Server up on http://localhost:3333
Resolved 21 LWC modules in 3985 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/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
[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
[view__preview.js] Done in 14077 ms
Writing C:\Users\jastend\Documents\GitHub\sfdc-cs\.localdevserver/public/webruntime/view/8317de4485/dev/en_US/preview.js...
[view__mainLayout.js] Done in 76 ms
Writing C:\Users\jastend\Documents\GitHub\sfdc-cs\.localdevserver/public/webruntime/view/67133358b1/dev/en_US/mainLayout.js...
[0] [view__home.js] (es2017, development): resourcesPanel.css Loading C:\Users\jastend\Documents\GitHub\sfdc-cs\package.json failed JSON parsing with error ENOENT: no such file or directory, open 'C:\Users\jastend\Documents\GitHub\sfdc-cs\package.json'
[lds] Done in 421 ms
Error: Error compiling force/lds
    at Proxy.compile (C:\Users\jastend\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\jastend\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:3460:30)
    at C:\Users\jastend\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/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
[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
[view__home.js] Done in 386 ms
Writing C:\Users\jastend\Documents\GitHub\sfdc-cs\.localdevserver/public/webruntime/view/eaf2cb0c78/dev/en_US/home.js...

Chrome console info:

moduleRegistry.js:129 Uncaught Error: Could not resolve entry (force/lds)
    at error (C:\Users\jastend\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:3460:30)
    at C:\Users\jastend\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:21359:17
(anonymous) @ lds.js:1
resolveExports @ moduleRegistry.js:141
addModule @ moduleRegistry.js:126
define @ moduleRegistry.js:95
(anonymous) @ lds.js:1
utils.js:7 Uncaught (in promise) Error: Cannot resolve dependency 'lightning/verticalNavigationSection'
    at assert$1 (utils.js:7)
    at Object.assign.__circular__ (moduleRegistry.js:161)
    at resolveCircularModuleDependency (engine.js:738)
    at c (engine.js:3432)
    at tmpl$1 (home.js:240)
    at evaluateTemplate (engine.js:4057)
    at engine.js:4228
    at runWithBoundaryProtection (engine.js:6106)
    at invokeComponentRenderMethod (engine.js:4218)
    at renderComponent (engine.js:4357)

Maybe this is related to the "Bad Request" issue (aggregate-ui issue): https://github.com/forcedotcom/lwc-dev-server-feedback/issues/1

ntotten commented 4 years ago

We are investigating this and will follow up shortly.

Mr-Liquid commented 4 years ago

@ntotten Much appreciated. Please let me know when you fix that.

monirkohi2006 commented 4 years ago

I have the same issue.

gatormike commented 4 years ago

I am getting a slightly different error message running locally. My local is trying to make the call using v. 48, but for some reason, the error coming back is showing v.47:

Request: Request URL: http://localhost:3333/api/services/data/v48.0/ui-api/records/a2I4F000000ai15UAA?optionalFields=..... Request Method: GET Status Code: 500 Internal Server Error Remote Address: [::1]:3333 Referrer Policy: no-referrer-when-downgrade

Response: Error occured while trying to proxy to: localhost:3333/services/data/v47.0/ui-api/records/a2I4F000000ai15UAA?optionalFields=....

Where can I find more details of the error that occurred?

KrisGraySFDC commented 4 years ago

We have patched local dev to give initial support for version 48. More changes are likely coming next week, but for now our hope is you are unblocked.

Be sure to update sfdx update

If you're still having issues, please let us know so we can investigate for our follow up improvements.

Dupe of #48

tosunilgupta commented 4 years ago

After performing the above mentioned command. i am facing the same problem. sfdx update

Still this is not working for my local environment.

Server up on http://localhost:3333 Resolved 21 LWC modules in 23261 ms [0] [rollup] 'lightning/breadcrumbs' is imported by C:\Users\myUser\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 C:\Users\myUser\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 C:\Users\myUser\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 71080 ms Writing d:\Users\myUser\Documents\GitHub\blocx-dev-lwc-v1.0.0-r1\.localdevserver/public/webruntime/view/8317de4485/dev/en_US/preview.js... [view__mainLayout.js] Done in 229 ms Writing d:\Users\myUser\Documents\GitHub\blocx-dev-lwc-v1.0.0-r1\.localdevserver/public/webruntime/view/67133358b1/dev/en_US/mainLayout.js... [lds] Done in 1515 ms Error: Error compiling force/lds at Proxy.compile (C:\Users\sgupta23\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\myUser\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:3460:30) at C:\Users\sgupta23\AppData\Local\sfdx\node_modules\rollup\dist\rollup.js:21359:17 [0] [rollup] 'lightning/verticalNavigationItemIcon' is imported by C:\Users\myUser\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/verticalNavigation' is imported by C:\Users\myUser\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 C:\Users\myUser\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 C:\Users\myUser\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 1713 ms Writing d:\Users\myUser\Documents\GitHub\blocx-dev-lwc-v1.0.0-r1\.localdevserver/public/webruntime/view/eaf2cb0c78/dev/en_US/home.js...

nstill1025356 commented 4 years ago

@Triopticon Have you tried updating your sfdx-project.json to "sourceApiVersion": "48.0"

I updated my plugins and everything worked correctly and I was able to get into the Local Server. This line in the sfdx-project.json was the only thing I changed since last week.

tosunilgupta commented 4 years ago

[Hooray] Finally we performed some steps and local environment is up as expected.

Step 1:: Please update the local sfdx version sfdx update

Step 2:: To update the sfdx local server, please install the plugin as per below command. sfdx plugins:install @salesforce/lwc-dev-server

Step 3:: Re-validate local sfdx environment version. sfdx plugins --core

Step 4:: Run the local server. sfdx force:lightning:lwc:start

Mr-Liquid commented 4 years ago

@KrisGraySFDC @tosunilgupta yes, now it works as expected. Much appreciated all of you guys. I guess we can close that bug.

KrisGraySFDC commented 4 years ago

Great!

Anks1856 commented 4 years ago

guys , i have complete solution of problem in installing package like, network error and killing process. ====>https://www.youtube.com/watch?v=YFVVFHbTznY