title: Angular 1.6.9 @uiRouter: Error: [ng:cpws] Can't copy! Making copies of Window or Scope instances is not supported
body: <p>I am trying to use gulp-browsify to load all the dependencies in one <code>app-release.js</code> file.</p>
  
  <p>The file builds fine but when I try to inject <code>@uiRouter</code> dependency I get the following error in the browser <a href="https://i.stack.imgur.com/ZJIWT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZJIWT.png" alt="enter image description here"></a></p>
  
  <p>Where as if I inject <code>angular-route</code> it works fine.</p>
  
  <p>Here is the code</p>
  
  <p><strong>gulpfile.js</strong></p>
  
  <pre><code>var gulp = require('gulp');
  var rename = require('gulp-rename');
  var browserify = require('gulp-browserify');
  var buffer = require('gulp-buffer');
  
  gulp.task('default', function() {
      gulp.src('app.js')
          .pipe(browserify({
              insertGlobals: false,
              debug: true
          }))
          .pipe(buffer())
          .pipe(rename('app-release.js'))
          .pipe(gulp.dest('app/'));
  });
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var angular = require('angular');
  var uiRouter = require('@uirouter/angularjs');
  var ngRoute = require('angular-route');
  
  var app = angular.module("app",[uiRouter]);
  
  app.config(function($stateProvider) {
      var helloState = {
          name: 'hello',
          url: '/',
          template: '&lt;h3&gt;hello world!&lt;/h3&gt;'
      }
  
      var aboutState = {
          name: 'about',
          url: '/about',
          template: '&lt;h3&gt;Its the UI-Router hello world app!&lt;/h3&gt;'
      }
  
      $stateProvider.state(helloState);
      $stateProvider.state(aboutState);
  });
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" ng-app="app"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Ui Router Test&lt;/title&gt;
      &lt;!--&lt;script type="text/javascript" src="/node_modules/angular/angular.js"&gt;&lt;/script&gt;--&gt;
      &lt;script src="app/app-release.js" type="application/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;a ui-sref="hello"&gt;Hello&lt;/a&gt;
  &lt;a ui-sref="about"&gt;About&lt;/a&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;!--&lt;a href="#!red"&gt;Red&lt;/a&gt;--&gt;
  &lt;!--&lt;a href="#!green"&gt;Green&lt;/a&gt;--&gt;
  &lt;!--&lt;a href="#!blue"&gt;Blue&lt;/a&gt;--&gt;
  &lt;!--&lt;div ng-view&gt;&lt;/div&gt;--&gt;
  &lt;ui-view&gt;&lt;/ui-view&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thank you for providing help :)</p>