You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yarn 2 will create virtual packages for those dependencies that have peer dependencies. The Karma plugins that we use such as karma-requirejs have a peer dependency on karma. The virtual package path that Yarn 2 generates is:
Problem is that the Karma middleware will try to generate the HTML file with all these paths but it uses the replace() function in JS and the double dollar sign $$ is a special pattern. It means replace with $. So the paths generated to put in the HTML code is:
Yarn 2 will create virtual packages for those dependencies that have peer dependencies. The Karma plugins that we use such as
karma-requirejs
have a peer dependency onkarma
. The virtual package path that Yarn 2 generates is:/Users/shahn/my-project-dir/.yarn/$$virtual/karma-requirejs-virtual-d16b0e1d06/0/cache/karma-requirejs-npm-0.2.5-fb217d2fa2-3.zip/node_modules/karma-requirejs/
So for example the
karma-requirejs
plugin will try to load thelib/adapter.js
file which would resolve to this path:/Users/shahn/my-project-dir/.yarn/$$virtual/karma-requirejs-virtual-d16b0e1d06/0/cache/karma-requirejs-npm-0.2.5-fb217d2fa2-3.zip/node_modules/karma-requirejs/lib/adapter.js
Problem is that the Karma middleware will try to generate the HTML file with all these paths but it uses the
replace()
function in JS and the double dollar sign$$
is a special pattern. It means replace with$
. So the paths generated to put in the HTML code is:/Users/shahn/my-project-dir/.yarn/$virtual/karma-requirejs-virtual-d16b0e1d06/0/cache/karma-requirejs-npm-0.2.5-fb217d2fa2-3.zip/node_modules/karma-requirejs/lib/adapter.js
This errors out with 404s.
There are several ways to go about fixing this but I figured I just pass in an arrow function instead and that would turn off the special patterns.
The text was updated successfully, but these errors were encountered: