Skip to content

In latest angular 4.1 / cli 1.1 getting Uncaught ReferenceError: require is not defined  #6106

@born2net

Description

@born2net

I'm submitting a ... (check one with "x")

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Up to ng 4.0.1 / cli 1.0 all was great
upg to 4.1 and 1.1 and now I am getting

Uncaught ReferenceError: require is not defined
  (anonymous function)	
  (anonymous function)	
  webpackJsonp.25.module.exports	
  732	
  __webpack_require__	
  1658	
  __webpack_require__	
  webpackJsonpCallback	
  (anonymous function)	

Looking at the stack won't help much:

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
module.exports = function(src) {
	if (typeof execScript !== "undefined")
		execScript(src);
	else
		eval.call(null, src);
}



//////////////////
// WEBPACK FOOTER
// ./~/script-loader/addScript.js
// module id = 25
// module chunks = 11

let me add that everything works, but getting this annoying message at runtime.

Expected behavior
no error

Minimal reproduction of the problem with instructions
You can see the issue with this project:
https://github.com/born2net/studio-lite

git clone https://github.com/born2net/studio-lite.git
cd studio-lite
npm install -g @angular/cli@latest
npm install
open browser to: http://localhost:4208/

versions:

@angular/cli: 1.0.1
node: 6.9.5
os: win32 x64
@angular/animations: 4.1.0
@angular/common: 4.1.0
@angular/compiler: 4.1.0
@angular/core: 4.1.0
@angular/forms: 4.1.0
@angular/http: 4.1.0
@angular/platform-browser: 4.1.0
@angular/platform-browser-dynamic: 4.1.0
@angular/router: 4.1.0
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.0
@angular/language-service: 4.1.0
@ngtools/webpack: 1.3.1

Regards,

Sean

Metadata

Metadata

Assignees

Labels

needs: repro stepsWe cannot reproduce the issue with the information given

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions