LoginSignup
0
0

LWC エラーの対処方法2

Last updated at Posted at 2023-04-23

Salesforce CLI is not installed

image.png

Set Salesforce CLI Path (Windows)
See Installing the Salesforce CLI. After installing Salesforce CLI, if you get the error ‘Salesforce CLI is not installed’, most likely Salesforce CLI is not added as a path variable. To verify or add Salesforce CLI to your Windows path variable:

https://developer.salesforce.com/tools/vscode/en/troubleshooting

「Salesforce CLI のインストール」を参照してください。 Salesforce CLI をインストールした後、「Salesforce CLI がインストールされていません」というエラーが表示された場合は、Salesforce CLI がパス変数として追加されていない可能性があります。 Salesforce CLI を確認または Windows パス変数に追加するには、次の手順を実行します

Warning

Warning: The "force auth web login" command has been deprecated. Use "org login web" instead.
Warning: The "--setalias" flag has been deprecated. Use "--alias | -a" instead.
Warning: The "--instanceurl" flag has been deprecated. Use "--instance-url | -r" instead.
Warning: The "--setdefaultusername" flag has been deprecated. Use "--set-default | -s" instead.
Error (1): Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: request to https://login.salesforce.com//services/oauth2/token failed, reason: self signed certificate in certificate chain

Please check this article.

https://developer.salesforce.com/forums/?id=9062I000000DKBwQAO

believe that was a problem connection. already is connected good.

You have not authorized your Trailhead playground org via Salesforce Extensions or Salesforce Command line (CLI). Please install the development tools specified in this step and connect to the Trailhead Playground.

I had this same issue and this "15 minute step" took me like 6-8 hours of troubleshooting over two days, which I finally just finished... The solution I found after uninstalling and reinstalling extensions, sfdx update multiple times, checked PATH multiple times, and every other thing I found on the web that didn't work was so simple yet not listed anywhere in the instructions and it wasn't a VS Code issue (for me at least).

Down at the bottom of the page for the task in trailhead right by the button for +100 points is your playground listing. Hit the dots next to it to pull up more menu options and there is one for linking. I can't get a screenshot since it's now complete and I don't want to start over, but if you click it you will have to login to salesforce and like two popups will ask you to verify stuff. Verify and it will take you back to trailhead where you will hit the +100 points button again and it should pass this time.

I'm not sure if there is an oversight in their instructions or if this was covered in one of the linked articles, but it gave me such a hard time for something so simple. I definitely feel like the trailhead instructions could be a little more clear. Hope this helps others avoid the headaches and downtime I took... Now maybe I can actually learn this platform :)

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000JgRNM

私も同じ問題を抱えていて、この「15 分のステップ」では 2 日間にわたってトラブルシューティングに 6 ~ 8 時間かかりましたが、ようやく完了しました...拡張機能をアンインストールして再インストールし、sfdx を複数回更新し、PATH を確認した後に見つけた解決策何度も繰り返しましたが、Web 上で見つけた動作しなかったものはどれも非常に単純でしたが、説明書のどこにも記載されておらず、(少なくとも私にとっては) VS Code の問題ではありませんでした。

Trailhead のタスクのページの下部、+100 ポイントのボタンのすぐ下に、プレイグラウンドのリストがあります。その横にあるドットを押してさらにメニュー オプションを表示すると、リンク用のオプションが表示されます。完了したので最初からやり直すつもりはないのでスクリーンショットは取れませんが、クリックすると Salesforce にログインする必要があり、確認を求める 2 つのポップアップのようなメッセージが表示されます。確認すると、登山口に戻り、そこで +100 ポイント ボタンを再度押すと、今度は通過するはずです。

彼らの指示に見落としがあるのか​​、それともリンク先の記事でこれが取り上げられているのかはわかりませんが、これほど単純なことで私は非常に苦労しました。登山口の説明がもう少しわかりやすくてもいいのにと思います。これが他の人が私が経験した頭痛やダウンタイムを回避するのに役立つことを願っています...これで、私は実際にこのプラットフォームを学ぶことができるかもしれません:)

We can't find a Lightning Web Component named 'selector'.

Follow the steps:

Lightning Web Component is not enabled in your org

To check if the Lightning Web Component is enabled, go to Setup > Lightning App Builder > Components and search the component as selector.

Lightning Web Component is installed in a different org or not published or not compatible salesforce version.

Finally, check selector.js file in the Handle Events in Lightning Web Components remove it and going on the order from trailhead. otherwise, reinstall it.

手順に従ってください:

Lightning Web コンポーネントが組織で有効になっていません

Lightning Web コンポーネントが有効かどうかを確認するには、[設定] > [Lightning アプリケーションビルダー] > [コンポーネント] に移動し、セレクタとしてコンポーネントを検索します。

Lightning Web コンポーネントが別の組織にインストールされているか、公開されていない、または互換性のない Salesforce バージョンにインストールされています。

最後に、Lightning Web コンポーネントのイベントの処理で selector.js ファイルを確認して削除し、Trailhead からの指示に従います。それ以外の場合は、再インストールしてください。

ContactController.cls * Illegal conversion from List to List (4:9)

I think that I figured this out. The ContactController.cls-meta.xml was interfering with the class somehow. When I deleted this, it ended up being ok.

image.png

これで分かったと思います。 ContactController.cls-meta.xml が何らかの理由でクラスに干渉していました。これを削除したら、無事に直りました。

No source backed components present in the package

I figured it out. I accidentally saved the github directory on my desktop, and created the new project in my default directory. Therefore, there wasn't anything that I was able to push to my org.

私はそれを考え出した。誤って github ディレクトリをデスクトップに保存し、デフォルトのディレクトリに新しいプロジェクトを作成してしまいました。したがって、組織にプッシュできるものは何もありませんでした。

We can’t find 'reduceErrors' imported into contactList.js#

I had to write the import as followed:

import {reduceErrors} from './c/ldsUtils'

SalesforceSDKCore. RestClientError error0.

image.png

I pushed all metadata items from my Mobile Offline Starter kit and it resolved the issue. There may have been a missing file(s) and/or a clear cache solved my issue.

destination path already exists and is not an empty directory

image.png

The file or directory that you tried to deploy or retrieve isn't in a package directory that's specified in your sfdx-project.json file. Add this location to your "packageDirectories" value, or deploy or retrieve a different file or directory

I was getting the same error on retrieving the components from org. So i went to the actual package.xml file on my vs code ide and right click > SFDX:Retreive Source in Manifest from org and it worked. Then you can try the SFDX: Deploy this source to Org

https://developer.salesforce.com/forums/?id=9062I000000IFKyQAO

組織からコンポーネントを取得するときに同じエラーが発生しました。そこで、vsコードIDEで実際のpackage.xmlファイルに移動し、右クリック> SFDX:Retreive Source in Manifest from orgをクリックすると機能しました。次に、SFDX を試すことができます: このソースを組織にデプロイします

違う組織に接続していた

No MODULE named markup://c:list found : [markup://c:selector]

We can’t find ‘Count_Updated.messageChannel-meta.xml’.

image.png

I resolved it by using a Windows OS VScode to deploy the message channel folder. I guess the issue is with the MacOS edition of VScode.

Windows OS VScode を使用してメッセージ チャネル フォルダーを展開することで解決しました。問題は VScode の MacOS 版にあると思います。

No such file or directory

sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://test.salesforce.com --setdefaultusername

/Users/[myUserName]/.local/share/sfdx/client/bin/sfdx: line 16: /Users/[myUserName]/.local/share/sfdx/client/bin/../7.209.6-8ba3197/bin/sfdx: No such file or directory

15:46:10.754 sfdx force:auth:web:login --setalias vscodeOrg --instanceurl https://test.salesforce.com --setdefaultusername

ended with exit code 1

Too many callouts: 101"

image.png

Encountered it for the first time today and was able to find the right info on my machine in .git > refs> remotes > origin > 'branch' .

今日初めてこれに遭遇し、 .git > refs > Remotes > Origin > 'branch' でマシン上の正しい情報を見つけることができました。

The Execute Anonymous Apex

CRTL+" > Execute Anonymous Apex > ENTER

"message": "error parsing or finding aura config: window.Aura not found" and in console --> app:9608 POST http://localhost:3333/webruntime/api/apex/execute 500 (Internal Server Error)

Unfortunately, there is no longer a solution to the problem. We cannot disable the Security Enhancements for CSRF Tokens for Lightning Apps release update to eliminate CSRF token validation on the org backend side. We also don't have any workaround other than mock data to be retrieved. There is also no workaround for performing data creation/update operations.

Deploying the metadata to the server and then saving the page in App Builder after each change doesn't look like a good development flow, similar to how we worked until 2020.

残念ながら、この問題に対する解決策はもうありません。 「Lightning アプリケーションの CSRF トークンのセキュリティ強化」リリース更新を無効にして、組織のバックエンド側での CSRF トークンの検証を排除することはできません。また、模擬データを取得する以外に回避策はありません。データの作成/更新操作を実行する場合の回避策もありません。

メタデータをサーバーにデプロイし、変更のたびに App Builder でページを保存するのは、2020 年までの作業方法と同様に、適切な開発フローとは思えません。

Entity of type 'EmailTemplate' named ' unfiled$public/my_email_template -o myOrg ' cannot be found.

Starting SFDX: Deploy Source to OrgINSUFFICIENT_ACCESS: use of the Metadata API requires a user with the ModifyAllData or ModifyMetadata permissions

To resolve this issue, do the following:

  1. Login to Salesforce
  2. Goto Setup > Manage Users > Users > Click on profile assigned to the User > Edit > Enable the ModifyAllData or ModifyMetadata permissions
  3. Save
  4. Republish Salesforce Connection.

https://knowledge.informatica.com/s/article/563897?language=en_US

It seems that you are likely authenticated as a non-administrator user.
Please try running "SFDX:Authorize an Org" from the command palette again.
This time, make sure to log in as a user with a system administrator profile.

おそらく管理者以外のユーザーとして認証されているようです。
コマンドパレットから「SFDX:Authorize an Org」を再度実行してください。
今回は、必ずシステム管理者プロファイルを持つユーザーとしてログインしてください。

FSL through package.xml from the Work Order object but the layout cannot be found.

特定のオブジェクトのページ レイアウトを package.xml に追加するにはどうすればよいですか?
https://salesforce.stackexchange.com/questions/241475/how-to-add-any-specific-objects-page-layout-in-package-xml

We could not find Apex class named 'AccountController'.

Warning: Ignoring extra certs from null, load failed: error:80000002:system library::No such file or directory

VSCode で複数の組織が接続または承認されている場合、コードはデフォルトの組織セットの 1 つにデプロイされる必要があります。

If you have multiple orgs connected or authorized in VSCode, then your code must be getting dpeloyed to one of the default org set.

Try setting the org you want to use as default using below command:

sfdx force:config:set defaultusername = 'Username that you want to use'

And then confirm the list of orgs by using below command:

https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8uZISAZ

I'm also concerned about SSL warning.
https://stackoverflow.com/questions/70365875/error-during-creation-self-signed-ssl-with-openssl

self-signed certificate in certificate chain

Error authenticating with auth code due to: request to https://login.salesforce.com//services/oauth2/token failed, reason: self-signed certificate in certificate chain

This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.

After installing node.js it started working for me. Not sure what was the issue.

Even it's working on company's VPN

node.js をインストールした後、機能し始めました。何が問題だったのかわかりません。

会社のVPNでも動作しています

This class name's value is invalid: AccountServiceTest. Provide the name of an Apex class that has test methods.

image.png

After creating a new Playground, I put the same code in VS and Deployed it to the Org. All was fine this time and I could complete the challenge

Error running command sfdx.force.source.retrieve.component: this.node.children is not iterable. This is likely caused by the extension that contributes sfdx.force.source.retrieve.component.

SFDX commands are depreciated, i suggest you should update the Salesforce Cli or if not updated in long time uninstall old version & install the new one.

SFDX コマンドは廃止されました。Salesforce Cli を更新するか、長期間更新されない場合は古いバージョンをアンインストールして新しいバージョンをインストールすることをお勧めします。

We can’t query your org. Make sure that you’re connected to this org and have permissions to view the object and fields.

structuredClone is not defined

Probably, you can solve the issue by trying a lower version of the Salesforce CLI Integration(vscode Extension), that might help.

I was able to confirm the operation in the following environment.

CLI Version : 2.25.7
Node.js : 20:11:0
Salesforce CLI Integration : v59.9.0

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007X8N5ySAF

StructureClone not defined

Update your VS code and Salesforce CLI with latest version and then try.
If it is latest one then uninstall Salesforce CLI and reinstall.
Check the path is correct or not

I got the same issue now it is resolved

S コードと Salesforce CLI を最新バージョンに更新してから試してください。
最新の場合は、Salesforce CLI をアンインストールして再インストールします。
パスが正しいかどうかを確認してください

同じ問題が発生しましたが、現在は解決されています

Installing plugin @ind-rcg/modeler-sfdx-cli-plugin@latest... failed

image.png

I took the task of analyzing the error, fortunately I have solved it, I was missing some components that were not installed.

Now everything works as before with the plugin update.

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007UtA2wSAF

私はエラーを分析する仕事を引き受けましたが、幸いにもそれは解決しました。インストールされていないコンポーネントがいくつかありませんでした。

プラグインの更新により、すべてが以前と同じように機能するようになりました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0