Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

ENOENT: no such file or directory, open 'force/empApiInternal'

Asked by Andrew Jenkins Jul 2, 2021 1.3K views 1 answer
Share

About this question

 I'm trying to implement Platform Events into my LWC - I'm following these docs: lightning-emp-api docs.

When I try and import the empApi into my LWC I get the following error: (NB, it only occurs in the local dev server, when I deploy to my sandbox it works perfectly fine)

Could not load force/empApiInternal (imported by /Users//.local/share/sfdx/node_modules/@salesforce/lwc-dev-server-dependencies/vendors/dependencies-224/lightning-pkg/src/lightning/empApi/empApi.js): ENOENT: no such file or directory, open 'force/empApiInternal'

My import :


import { subscribe, unsubscribe, onError, setDebugFlag, isEmpEnabled } from 'lightning/empApi'; I know I could just constantly deploy to my org during development, but thats such a bad experience, I want to make sure it the only option. How do I fix error Enoent No such file or directory open?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.