Karma: After upgrade to ionic 3: ERROR in ./src/+some.component.ts (20,15): error TS2304: Cannot find name 'require'


#1

ERROR in ./src/+some.component.ts (20,15): error TS2304: Cannot find name 'require'.

That is what Webpack throws when I do

karma start ./test-config/karma.conf.js

But: We have not one single require in the entire app.


#2

declare var require: any;

=)


#3

Resolved by removing @types/jasmine and other test-related types from package.json


#4

This declare was useful to get rid of the TS2304: Cannot find name ‘require’ error when I installed a needed Node


#5

Glad to help! It’s come up so often for me on projects.