Problems with karma with loading the require.js module

I am trying to use the Karma tester in PyCharm. I ran the init script karma and selected the inclusion of the Require.js plugin from this init script. Then, when I tried to run the tester, I got the following notifications: Uncaught Error: Module name "assert" has not been loaded yet for context: _. Use require([]) Uncaught Error: Module name "assert" has not been loaded yet for context: _. Use require([])

So I had to download assert using "npm install assert" and then include such a line in my karma.conf.js file: {pattern: 'node_modules/assert/assert.js', included: true}, in the file array .

But now I get a similar complaint: Uncaught Error: Module name "util/" has not been loaded yet for context: _. Use require([]) Uncaught Error: Module name "util/" has not been loaded yet for context: _. Use require([]) , and although I installed using the npm install util utility and the folder now appears in my node_modules folder, I can’t fix anything.

Any suggestions would be highly appreciated.

+6
source share

Source: https://habr.com/ru/post/978754/


All Articles