I run in angular 4 project with ng serve and i get error
Cannot read property \'length\' of undefined
but I don\'t have any property length in
My problem was that, for some reason, my envioroment.ts file was missing. So check important files.
I solved this problem (error during refactoring test). All is good for angular v4.3.* and v4.4*
@angular/cli
version 1.7.3 to 1.4.10 in package.json (latest for angular4)rm -rf node_modules
npm install --no-optional
You might be missing one or more files that typescript is trying to process. To find out which file you are missing just add
console.log(fileName);
at the starting of the createSourceFile
function at node_modules/typescript/lib/typescript.js file.