did Polymer 1.0 break requirejs

319 Views Asked by At

Calling requirejs' require function after Polymer 1.0 has been loaded results in a mismatch error.

This used to work fine with Polymer 0.5

1

There are 1 best solutions below

0
On

It would be helpful to know what exactly you tried to give an informed answer. When I encountered a similar issue, The steps I took to resolve the issue was the following.

  1. I removed the requirejs related script which was in the same page that was loading the Polymer 1.0 elements.
  2. I then created a new module using a definition function, containing the script I had removed in step one.
  3. I then loaded this new module in the page containing the Polymer 1.0 elements using a requirejs script tag referring to the new module I just created, with data-main attribute. An example of script tag I used is shown below

    <script data-main="./defineTests"  src="../bower_components/requirejs/require.js"></script>