Good morning, could someone help me with the error "Error loading the component "Custom_Module/js/customer-lines" that occurs to me when loading a JS knockout file, the error appears a few times, that is to say that sometimes the component is loaded

I have tried to solve the problem in many ways, but it does not work for me.

Phtml file that loads the js "app/code/Custom/Module/view/frontend/templates/lines.phtml".

enter image description here

JS app/code/Custom/Module/view/frontend/web/js/customer-lines.js

enter image description here

Thank you for your attention if you help me I will be very grateful.

  • 1
    It may be helpful to include the path of the files that you reference. Commented Sep 26, 2022 at 18:54
  • It is understood
    – GStiven
    Commented Sep 26, 2022 at 19:23

1 Answer 1


I think the problem here is that you are trying to load a phtml file. The js component usually call a knockout template with html extension.

These files are located in web/template folder and not in templates. Static files (like html, css and js) for each module are published on pub/static///... so js can call the html file at the same level, phtml files are not located here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.