Closed ViieeS closed 6 years ago
Temporary fix it by remove init checks:
Did you load angular before loading this script?
Could you give us a fragment of your index.html or comparable to spot the issue?
Yes, angular is first import:
require('angular');
require('./../../vendors/angular-google-analytics/dist/angular-google-analytics.min.js');
Here's snippet of my building task:
return browserify(paths.js, {
fullPaths: true
})
.bundle()
.pipe(source(bundle + '.js'))
.pipe(gulp.dest(config.bundle))
Fixed after migrating from bower
to npm
Imports now looks like:
require('angular');
require('angular-google-analytics');
Before was imported from bower directory vendors
:
require('./../../vendors/angular-google-analytics/dist/angular-google-analytics.min.js');
I think it was some problem with files in bower repo, but because bower is deprecated now I think we can close the task.
Cannot find module 'angular' from '.../vendors/angular-google-analytics/dist'
I define it like this:
maybe problem with this