lwc-dev-serverのまとめ



+ [Localhost:3333 not working, stays charging](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007A44zw)

I'm trying to use the lwc-dev-server but the page keeps loading and never displays anything after executing the start local development server command.

画像見たときは気付かなかったけど、白い画面になっていますね。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/82dafb85-9141-76a8-3404-df10e227748d.png)

既知の問題みたい

:::note
Describe the bug
With the latest release of the LWC Dev Server, there is a known issue where upon loading http://localhost:3333/ (or substitute with custom port), the user is presented with a blank screen. 

Workaround
Restart local dev server.

https://github.com/forcedotcom/lwc-dev-server-feedback/issues/91
:::

結局は再インストールしたらしい

Finally I was able to find the solution. I uninstalled sfdx cli completely, reinstalled it, installed dev-server and it worked fine. Apparently the installation was incomplete or damaged at first, but I worked with Apex, LWC calmly, I only had problems with the dev-server.

 
+ [How to correct Error installing @salesforce/lwc-dev-server](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007I5h3q)

よくわからんけど、解決したらしい

+ [Can't install local development server](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007HBTMf)

:::note alert
HTTPError: Response code 403 (Forbidden)
Code: ERR_NON_2XX_3XX_RESPONSE
:::

+ [LWC ローカル開発サーバのインストールのエラーについて](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007Px755)

バージョンが非推奨になっている

# Macにインストールできない( M1 ARMベースのCPU）

+ [Can't install lwc-dev-server on macOS arm](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007UtRuK)

:::note
I was getting installation issues on my Mac as well. I finally figured the solution. SFDX CLI needs to be installed via NPM, and not directly with the installer. Also it is only Supported with Node V18. What I effectively did was:

1. Remove SF CLI: [Link](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_uninstall.htm)
2. Used NVM to install and use Node 18( As I already had a different version installed)
3. Installed SFDX CLI via NPM: [Link](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm?&_ga=2.255994511.588198954.1736025517-473931632.1735343094#sfdx_setup_install_cli_npm)

I tried installing the plugin and it installed successfully.
:::

+ [Unable to Install @salesforce/lwc-dev-server on macOS ARM](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007Yw7sjSAB)
+ [How to install the local development server on mac?](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4OVhSAN)
+ [I am using Mac m3 pro max 2024 model.](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000KBM9h)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/4639f889-abb5-ddaa-32ae-9abeeb2f8dca.png)


:::note
私は間違った方法で salesforce cli をアンインストールしていました。npm を使用してアンインストールした後でも、salesforce cli がまだ残っていることがわかりました。インストーラーを使用して直接ダウンロードしたに違いありません。

```bash
sudo rm -rf /usr/local/sfdx
sudo rm -rf /usr/local/lib/sfdx
sudo rm -rf /usr/local/bin/sfdx
sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
sudo rm -rf ~/Library/Caches/sfdx
sudo rm -rf /usr/local/sf
sudo rm -rf /usr/local/bin/sf
sudo rm -rf ~/.local/share/sf ~/.config/sf ~/.cache/sf
sudo rm -rf ~/Library/Caches/sf
```

Clear other associated files
sudo rm -rf ~/.sfdx
sudo rm -rf ~/.sf

Then installed it again with npm.
:::