forcedotcom / lwc-dev-server-feedback

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

lwc-dev-server installation fails due to "JavaScript heap out of memory" #130

Open ceciliaporro opened 2 years ago

ceciliaporro commented 2 years ago

Describe the bug Trying to install lwc-dev-server using the command "sfdx plugins:install @salesforce/lwc-dev-server", I get the error: "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory"

To Reproduce Steps to reproduce the behavior:

  1. Go to terminal inside a Salesforce project
  2. Run command 'sfdx plugins:install @salesforce/lwc-dev-server'
  3. Wait for completion - if needed, run npm install -g node-gyp
  4. See error: "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory"

Expected behavior Running sfdx plugins --core, I should see the plugin lwc-dev-server and be able to start it up. Screenshots

Schermata 2022-01-10 alle 18 04 05

Desktop (please complete the following information):

Additional context I was trying to launch dev server to preview and complete a trailhead badge. Trying to start up using VScode sfdx command: preview component locally, it tells me to install plugin "lwc-dev-server". Then, when I try to install it, this happens. Found nothing on the web related to this bug.

stale[bot] commented 2 years ago

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

jsmithdev commented 1 year ago

You may have been hitting the memory limit Node itself has / may not be a lwc dev server issue.

You could test theory by running below to set a higher memory limit for Node prior to starting the server:

env NODE_OPTIONS=--max_old_space_size=4096 sfdx force:lightning:lwc:start 

More info: https://stackoverflow.com/a/38560292/1705082 https://github.com/nodejs/node/issues/18889

stale[bot] commented 1 year ago

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