Why data bind template is not working on 2.2 or greater?Template override not workingMagento2 : How to bind...

Did US corporations pay demonstrators in the German demonstrations against article 13?

Is infinity mathematically observable?

Calculating the number of days between 2 dates in Excel

My boss asked me to take a one-day class, then signs it up as a day off

Partial sums of primes

What will be the benefits of Brexit?

Adding empty element to declared container without declaring type of element

Stereotypical names

Why is delta-v is the most useful quantity for planning space travel?

node command while defining a coordinate in TikZ

Visiting the UK as unmarried couple

How to deal with or prevent idle in the test team?

Is there enough fresh water in the world to eradicate the drinking water crisis?

word describing multiple paths to the same abstract outcome

Indicating multiple different modes of speech (fantasy language or telepathy)

Resetting two CD4017 counters simultaneously, only one resets

How did Monica know how to operate Carol's "designer"?

Have I saved too much for retirement so far?

How to check participants in at events?

Can a Gentile theist be saved?

Identify a stage play about a VR experience in which participants are encouraged to simulate performing horrific activities

Pronouncing Homer as in modern Greek

What is the term when two people sing in harmony, but they aren't singing the same notes?

For airliners, what prevents wing strikes on landing in bad weather?



Why data bind template is not working on 2.2 or greater?


Template override not workingMagento2 : How to bind custom Knockout Method to a data-bind?Magento 2 Knockout JS How to bind data from response of ajax callMagento 2 knockoutjs error data-bind even?Magento2: Override template not workingTemplate overriding not workingMagento 2, why data-mage-init validation not working when I use knockout componentHow to bind the image in ko templateMagento2: HTML tag is not working in custom email templateChange knockout a href data-bind to link to image













0















I was studying about Knockout.js and how it works with Magento 2.



Then I reached the topic: template integration, in the first sample of it I'm presented to this notation:



<div data-bind="template:'Namespace_Module/sample'"></div>


Which will try to render the template located at:



app/code/Namespace/Module/view/frontend/web/template/sample.html


It's working in Magento versions equals/lower than 2.1.



In greater versions it's throwing the following error:



Uncaught TypeError: Unable to process binding "template: function(){return 'Namespace_Module/sample' }"
Message: Cannot read property 'name' of undefined
at RemoteTemplateEngine.makeTemplateSource (engine.js:55)
at RemoteTemplateEngine.renderTemplate (engine.js:116)
at executeTemplate (knockout.js:4886)
at ko.dependentObservable.disposeWhen (knockout.js:4950)
at evaluateImmediate (knockout.js:1737)
at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
at Object.ko.renderTemplate (knockout.js:4942)
at update (knockout.js:5080)
at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
at evaluateImmediate (knockout.js:1737)


I was trying to understand why it's happening looking for the change in github, but it's not clear to me:



https://github.com/magento/magento2/commit/d99043c097816388b2aeec1c23e10bf15e064b28#diff-9ec27f11f8253078a99c9d1e979a07f3



Now it requires a bindingContext (which contain the name attribute requested in exception) but I don't know how it's initialized.









share



























    0















    I was studying about Knockout.js and how it works with Magento 2.



    Then I reached the topic: template integration, in the first sample of it I'm presented to this notation:



    <div data-bind="template:'Namespace_Module/sample'"></div>


    Which will try to render the template located at:



    app/code/Namespace/Module/view/frontend/web/template/sample.html


    It's working in Magento versions equals/lower than 2.1.



    In greater versions it's throwing the following error:



    Uncaught TypeError: Unable to process binding "template: function(){return 'Namespace_Module/sample' }"
    Message: Cannot read property 'name' of undefined
    at RemoteTemplateEngine.makeTemplateSource (engine.js:55)
    at RemoteTemplateEngine.renderTemplate (engine.js:116)
    at executeTemplate (knockout.js:4886)
    at ko.dependentObservable.disposeWhen (knockout.js:4950)
    at evaluateImmediate (knockout.js:1737)
    at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
    at Object.ko.renderTemplate (knockout.js:4942)
    at update (knockout.js:5080)
    at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
    at evaluateImmediate (knockout.js:1737)


    I was trying to understand why it's happening looking for the change in github, but it's not clear to me:



    https://github.com/magento/magento2/commit/d99043c097816388b2aeec1c23e10bf15e064b28#diff-9ec27f11f8253078a99c9d1e979a07f3



    Now it requires a bindingContext (which contain the name attribute requested in exception) but I don't know how it's initialized.









    share

























      0












      0








      0








      I was studying about Knockout.js and how it works with Magento 2.



      Then I reached the topic: template integration, in the first sample of it I'm presented to this notation:



      <div data-bind="template:'Namespace_Module/sample'"></div>


      Which will try to render the template located at:



      app/code/Namespace/Module/view/frontend/web/template/sample.html


      It's working in Magento versions equals/lower than 2.1.



      In greater versions it's throwing the following error:



      Uncaught TypeError: Unable to process binding "template: function(){return 'Namespace_Module/sample' }"
      Message: Cannot read property 'name' of undefined
      at RemoteTemplateEngine.makeTemplateSource (engine.js:55)
      at RemoteTemplateEngine.renderTemplate (engine.js:116)
      at executeTemplate (knockout.js:4886)
      at ko.dependentObservable.disposeWhen (knockout.js:4950)
      at evaluateImmediate (knockout.js:1737)
      at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
      at Object.ko.renderTemplate (knockout.js:4942)
      at update (knockout.js:5080)
      at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
      at evaluateImmediate (knockout.js:1737)


      I was trying to understand why it's happening looking for the change in github, but it's not clear to me:



      https://github.com/magento/magento2/commit/d99043c097816388b2aeec1c23e10bf15e064b28#diff-9ec27f11f8253078a99c9d1e979a07f3



      Now it requires a bindingContext (which contain the name attribute requested in exception) but I don't know how it's initialized.









      share














      I was studying about Knockout.js and how it works with Magento 2.



      Then I reached the topic: template integration, in the first sample of it I'm presented to this notation:



      <div data-bind="template:'Namespace_Module/sample'"></div>


      Which will try to render the template located at:



      app/code/Namespace/Module/view/frontend/web/template/sample.html


      It's working in Magento versions equals/lower than 2.1.



      In greater versions it's throwing the following error:



      Uncaught TypeError: Unable to process binding "template: function(){return 'Namespace_Module/sample' }"
      Message: Cannot read property 'name' of undefined
      at RemoteTemplateEngine.makeTemplateSource (engine.js:55)
      at RemoteTemplateEngine.renderTemplate (engine.js:116)
      at executeTemplate (knockout.js:4886)
      at ko.dependentObservable.disposeWhen (knockout.js:4950)
      at evaluateImmediate (knockout.js:1737)
      at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
      at Object.ko.renderTemplate (knockout.js:4942)
      at update (knockout.js:5080)
      at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
      at evaluateImmediate (knockout.js:1737)


      I was trying to understand why it's happening looking for the change in github, but it's not clear to me:



      https://github.com/magento/magento2/commit/d99043c097816388b2aeec1c23e10bf15e064b28#diff-9ec27f11f8253078a99c9d1e979a07f3



      Now it requires a bindingContext (which contain the name attribute requested in exception) but I don't know how it's initialized.







      template knockoutjs frontend-error





      share












      share










      share



      share










      asked 5 mins ago









      Eduan LenineEduan Lenine

      34




      34






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267325%2fwhy-data-bind-template-is-not-working-on-2-2-or-greater%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267325%2fwhy-data-bind-template-is-not-working-on-2-2-or-greater%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown