Skip to main content
学 槻ノ木沢 님이 #Salesforce Developer에 질문했습니다

Unable to resolve issue with default file created from sf generate component command.

sf project generate --name sampleProjectcd sampleProject npm installsf lightning generate component --name myComponent --type lwc --output-dir force-app/main/default/lwc

Open 'lwc/myComponent/__tests__/myComponent.test.js' file in vscode, problem is displayed.

How to fix vscode probrem LWC1702 on lwc's default test.js

I can't solve the problem because I don't have enough detail about this probrem.

  • I'ts only vscode problem
    • test running is fine 
  • .forceignore file is already added.
    • **/__test__/**
    • it is not compliation error
답변 8개
  1. 2024년 4월 21일 오후 4:46
    import { createElement } from '@lwc/engine-dom';

    Adding this resolved the error for me.

0/9000