angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.78k stars 11.98k forks source link

`Uncaught ReferenceError: require is not defined` in production mode #1431

Closed refrigerator closed 8 years ago

refrigerator commented 8 years ago
  1. OS OSX El Capitan
  2. Versions angular-cli: 1.0.0-beta.9 node: 4.4.7 os: darwin x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc. Everything builds fine, and works fine in dev mode. In production mode, it builds fine but in the console I get this error: Uncaught ReferenceError: require is not defined at app-concat.js:61.
  4. The log given by the failure. Normally this include a stack trace and some more information. The log isn't very helpful: Uncaught ReferenceError: require is not defined(anonymous function) @ app-concat.js:61(anonymous function) @ app-concat.js:61
  5. Mention any other details that might be useful. Might be relevant - I'm using the --mobile version. I'm also using some modules that might be causing it but I have no idea:
vendorNpmFiles: [
      'systemjs/dist/system-polyfills.js',
      'systemjs/dist/system.src.js',
      'zone.js/dist/**/*.+(js|js.map)',
      'es6-shim/es6-shim.js',
      'alertify/**/*.js',
      'reflect-metadata/**/*.+(ts|js|js.map)',
      'rxjs/**/*.+(js|js.map)',
      '@angular/**/*.+(js|js.map)',
      'core-js/**/*.js',
      'pouchdb/**/*.js',
      'pouchdb-authentication/**/*.js',
      'pouchdb-find/**/*.js',
      'pouchdb-quick-search/dist/*.js',
      'ng2-charts/**/*.+(ts|js|js.map)',
      'ng2-bootstrap/**/*',
      'primeng/**/*.js',
      'primeui/**/*.*',
      'ng2-bs3-modal/**/*.js',
      'd3/d3.min.js',
      'jquery/dist/jquery.min.js',
      'bootstrap/dist/**/*.+(css|js)',
      'chart.js/dist/Chart.bundle.min.js',
      'fullcalendar/dist/**/*.+(css|js)',
      'moment/moment.js'
    ]

Thanks!

filipesilva commented 8 years ago

Closed as this issue was made obsolete by https://github.com/angular/angular-cli/pull/1455.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.