Closed elvisbegovic closed 6 years ago
@istiti can you fill out the issue template and give the steps to reproduce? What version of the cli are you updating from?
@deebloo please apologize see point 1 again. I have no additional info:
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:14552:109)
at parseSourceFileWorker (C:\Users\.....\node_modules\typescript\lib\typescript.js:14484:26)
at Object.parseSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:14433:26)
at Object.createSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:14288:29)
at WebpackCompilerHost.getSourceFile (C:\Users\.....\node_modules\@ngtools\webpack\src\compiler_host.js:210:27)
at findSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:63453:29)
at processSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:63384:27)
at C:\Users\.....\node_modules\typescript\lib\typescript.js:63494:17
at Object.forEach (C:\Users\.....\node_modules\typescript\lib\typescript.js:1293:30)
at processReferencedFiles (C:\Users\.....\node_modules\typescript\lib\typescript.js:63492:16)
at findSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:63477:21)
at processImportedModules (C:\Users\.....\node_modules\typescript\lib\typescript.js:63600:25)
at findSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:63481:17)
at processSourceFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:63384:27)
at processRootFile (C:\Users\.....\node_modules\typescript\lib\typescript.js:63271:13)
at C:\Users\.....\node_modules\typescript\lib\typescript.js:62620:60
at Object.forEach (C:\Users\.....\node_modules\typescript\lib\typescript.js:1293:30)
at Object.createProgram (C:\Users\.....\node_modules\typescript\lib\typescript.js:62620:16)
at AotPlugin._setupOptions (C:\Users\.....\node_modules\@ngtools\webpack\src\plugin.js:124:28)
at new AotPlugin (C:\Users\.....\node_modules\@ngtools\webpack\src\plugin.js:23:14)
at _createAotPlugin (C:\Users\.....\node_modules\@angular\cli\models\webpack-configs\typescript.js:55:12)
at Object.exports.getNonAotConfig (C:\Users\.....\node_modules\@angular\cli\models\webpack-configs\typescript.js:70:19)
at NgCliWebpackConfig.buildConfig (C:\Users\.....\node_modules\@angular\cli\models\webpack-config.js:27:37)
at Class.run (C:\Users\.....\node_modules\@angular\cli\tasks\serve.js:37:98)
at check_port_1.checkPort.then.port (C:\Users\.....\node_modules\@angular\cli\commands\serve.js:103:26)
at process._tickCallback (internal/process/next_tick.js:103:7)
@istiti Did you use ng new
to create the project?
If so, make sure that you kept all original arrays in .angular-cli.json
configuration like assets
, styles
and scripts
. I received mistake as you do, because I removed assets
option from .angular-cli.json
.
@metamaker no I don't use ng new I have assets styles and scripts as array. I try on exisiting project running angular 2.4.8 ith cli31 to update to cli-rc0 and angular rc1 !
Provide your .angular-cli.json
, please.
https://gist.github.com/istiti/e544744f16480829416e62b32167051e
ps: when running ng new test --ng4 it works... but I want get working again my existing project
Your .angular-cli.json
looks ok, not sure what is wrong. Maybe someone else will be able to help you ;) .
additional info :
I tried in green project "ng new mynewproject --ng4
" it work well, it run!
then move all my old /app folder to this new one and I get same error !
apparently the issue is in my code/module ... My project is relativly big I can't remove module by module :(
how achieve this ? can I get more signifiant message error
thanks
This is a real issue and we will look at it.
Additionals infos: Yes of course I always use Renderer and template in my project.. but need more signifiant message error to achieve this properlly.
Thanks, actually can't move...
Cc @hansl
@isiti can you provide a repository or some sort of code sample that we could use to reproduce? Maybe your package.json might be enough, if you're okay to share that.
Will do it tomorrow at 7AM (UTC +1)
Thanks coz can't move (actually blocked)
@Hansl
I was experiencing the same issue here and after I rolled typescript back from 2.2.1
to 2.0.10
that seemed to fix it.
@hansl here you are https://gist.github.com/istiti/f97eb83c6d18fd1d23965e4a3325033e
@trentmswanson FYI after passing from 2.1.6 to 2.0.10 I get this error
then when I update typescript from 2.0.10 to 2.2.1 I get same error as in 2.1.6
The strange thing here: the project with angular-cli rc.0 was working fine till executing the first ng build --target=production
(maybe just a coincidence). Since then the project is broken. ng serve
gives the same error now.
When I setup a new project, it is possible to build.
I removed and reinstalled angular-cli like documented (including node_modules) - the same. Also downgraded Typescript to 2.0.0 like the default for a blank project and took all possible settings of a blank project.
Checking out from the repository into a new directory and running npm install
fixed the issue - the files are the same. The project in the original directory became suddenly unusable - was not able to find out the reason.
As said : I putt in new green cli --ng4 project whole my /app folder and same issue
Apart from the lack of a descriptive message (which is the main focus for this issue), should anyone run into this case, don't panic - chances are that it's just a temporary glitch. I ran into this situation twice and it looked like a local problem with syncing files. The second incident of mine was a bit more clear to me - it followed a git pull
. Waiting ca 1 minute and rebooting ng serve cured the app and restored its running state.
FWIW: Since this is ng serve
reboot that helps, I would recommend to look closer at the angular-cli.json file - perhaps into the apps.assets
item which has been made a mandatory array if I am correct (meaning it does not accept a single string anymore).
additional info: same behavior with angular rc2
with this conf. my project works/compile fine with typescript 2.1.6 here's my working package.json:
@angular/cli: 1.0.0-rc.0
node: 6.9.2
os: win32 x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.9
when I add these lines to my package.json, I getlength undefined
:
"@angular/common": ">=4.0.0-beta <5.0.0",
"@angular/compiler": ">=4.0.0-beta <5.0.0",
"@angular/core": ">=4.0.0-beta <5.0.0",
"@angular/forms": ">=4.0.0-beta <5.0.0",
"@angular/http": ">=4.0.0-beta <5.0.0",
"@angular/platform-browser": ">=4.0.0-beta <5.0.0",
"@angular/platform-browser-dynamic": ">=4.0.0-beta <5.0.0",
"@angular/router": ">=4.0.0-beta <5.0.0"
same issue for me.
I get this error only when building/serving with --prod flag:
"@angular/cli": "1.0.0-rc.0",
"@angular/common": "^2.4.8",
"@angular/compiler": "^2.4.8",
"@angular/compiler-cli": "^2.4.8",
"@angular/core": "^2.4.8",
"@angular/forms": "^2.4.8",
"@angular/http": "^2.4.8",
"@angular/platform-browser": "^2.4.8",
"@angular/platform-browser-dynamic": "^2.4.8",
"@angular/router": "^3.4.8",
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (/home/...../node_modules/typescript/lib/typescript.js:14546:109)
at parseSourceFileWorker (/home/...../node_modules/typescript/lib/typescript.js:14478:26)
at Object.parseSourceFile (/home/...../node_modules/typescript/lib/typescript.js:14427:26)
at Object.createSourceFile (/home/...../node_modules/typescript/lib/typescript.js:14282:29)
at VirtualFileStats.getSourceFile (/home/...../node_modules/@ngtools/webpack/src/compiler_host.js:66:35)
at WebpackCompilerHost.getSourceFile (/home/.....node_modules/@ngtools/webpack/src/compiler_host.js:213:38)
at findSourceFile (/home/...../node_modules/typescript/lib/typescript.js:63447:29)
at processImportedModules (/home/...../node_modules/typescript/lib/typescript.js:63594:25)
at findSourceFile (/home/...../node_modules/typescript/lib/typescript.js:63475:17)
at processSourceFile (/home/.....node_modules/typescript/lib/typescript.js:63378:27)
at processRootFile (/home/...../node_modules/typescript/lib/typescript.js:63265:13)
at /home/...../node_modules/typescript/lib/typescript.js:62614:60
at Object.forEach (/home/...../node_modules/typescript/lib/typescript.js:1293:30)
at Object.createProgram (/home/...../node_modules/typescript/lib/typescript.js:62614:16)
at AotPlugin._setupOptions (/home/...../node_modules/@ngtools/webpack/src/plugin.js:124:28)
at new AotPlugin (/home/...../node_modules/@ngtools/webpack/src/plugin.js:23:14)
at _createAotPlugin (/home/...../node_modules/@angular/cli/models/webpack-configs/typescript.js:55:12)
at Object.exports.getAotConfig (/home/...../node_modules/@angular/cli/models/webpack-configs/typescript.js:89:19)
at NgCliWebpackConfig.buildConfig (/home/...../node_modules/@angular/cli/models/webpack-config.js:26:37)
at Class.run (/home/...../node_modules/@angular/cli/tasks/build.js:27:92)
at Class.run (/home/...../node_modules/@angular/cli/commands/build.js:143:26)
at Class.<anonymous> (/home/...../node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
I have the same issue on ubuntu 14.04 with node 7.6.0, npm 4.1.2 when running: ng build
. works on my windows machine. here is my package.json.
"dependencies": {
"@angular/common": "^2.4.8",
"@angular/compiler": "^2.4.8",
"@angular/core": "^2.4.8",
"@angular/forms": "^2.4.8",
"@angular/http": "^2.4.8",
"@angular/platform-browser": "^2.4.8",
"@angular/platform-browser-dynamic": "^2.4.8",
"@angular/router": "^3.4.8",
"@ngx-translate/core": "^6.0.0",
"@ngx-translate/http-loader": "0.0.3",
"bootstrap-sass": "^3.3.6",
"core-js": "^2.4.1",
"intl": "^1.2.4",
"jquery-ui": "^1.12.0",
"moment": "^2.13.0",
"ng2-bootstrap": "^1.1.2",
"ng2-file-upload": "^1.1.0",
"ng2-toastr": "^1.5.1",
"ng2-ui-auth": "^6.1.3",
"node-sass": "^3.7.0",
"primeng": "^2.0.1",
"primeui": "^4.1.15",
"rxjs": "^5.1.0",
"zone.js": "^0.7.6"
},
"devDependencies": {
"@angular/cli": "^1.0.0-rc.0",
"@angular/compiler-cli": "^2.4.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.4.2",
"typescript": "~2.0.0"
}
Probably not the same cause but we had the same error (Cannot read property 'length' of undefined
) when we accidentally deleted environment.prod.ts
during a refactoring process. Restoring this file solved our problem.
@moosetraveller Thanks a lot. This actually happened to be the issue. On our staging server we had no environment file set up.
nop, it's not same cause... I have this file under src/environments/environments.prod.ts
cc @moosetraveller
Issue was resolved by adding an environment.prod.ts
file as stated by @moosetraveller. Thanks!
Though, an error message more appropriate to the cause would be much appreciated.
donno why to me it isn't resolved :S and I have this file inside my project :s
@istiti
content of my environment.prod.ts
:
export const environment = {
production: true,
silent: false
};
Maybe, there are additional causes for this issue. CLI error message is misleading in this case.
i had the same problem, other cause: one of my dependencies referenced a .d.ts file which was simply not there (https://github.com/swimlane/ngx-charts/blob/master/release/d3.js#L1) if i run ng build without aot and prod flag, it would try to lookup that file which resultet in that error
anyway, now i am not sure, if i am doing it wrong, or if @swimlane has an error here...
@istiti there is a Stackoverflow (http://stackoverflow.com/a/41231897/42659) answer pointing out that the source folder may not be found/readable
I think in many cases this issue is caused when typescript tries to process a file that doesn't exist. In one of my projects it was a missing .d.ts
file. In another it was a missing environment ts file. Adding a console.log(fileName)
in the beginning of the createSourceFile
function at node_modules/typescript/lib/typescript.js
helped me pinpoint the specific file. Remember to remove the changes or just reinstall your node_modules
.
guys thanks to solve this bug to me ! i effectivly had this /// reference to .d.ts file not exist anymore in angular4 !
one of my team member import this file accidently, he don't remember why he did this, this file was available before in ng 2.x (i think)
<reference path="../../../../../node_modules/@angular/core/src/facade/async.d.ts"/>
in another file he imported isPresent from "@angular/core/src/facade/lang"
but this isPresent is now in this path "@angular/core/typings/src/facade/lang";
ps: i still not understand what is this isPresent but good no more this insignifiant error1
I let this issue open until a team memeber improve message error terminal cc @ctaepper @calebkiage , @hansl
Happy to help. :-)
Hi, has anyone solved this? I am still getting the same error:
Chriss-iMac:dnd-test christarasovs$ ng serve
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8980:109)
at parseSourceFileWorker (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8940:26)
at Object.parseSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8899:26)
at Object.createSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8727:29)
at WebpackCompilerHost.getSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/@ngtools/webpack/src/compiler_host.js:210:27)
at findSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45859:29)
at processSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45790:27)
at /Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45901:17
at Object.forEach (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:1115:30)
at processReferencedFiles (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45899:16)
at findSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45884:21)
at processSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45790:27)
at processRootFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45694:13)
at /Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45151:60
at Object.forEach (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:1115:30)
at Object.createProgram (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45151:16)
at AotPlugin._setupOptions (/Users/christarasovs/Desktop/dnd-test/node_modules/@ngtools/webpack/src/plugin.js:124:28)
at new AotPlugin (/Users/christarasovs/Desktop/dnd-test/node_modules/@ngtools/webpack/src/plugin.js:23:14)
at _createAotPlugin (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/models/webpack-configs/typescript.js:55:12)
at Object.exports.getNonAotConfig (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/models/webpack-configs/typescript.js:70:19)
at NgCliWebpackConfig.buildConfig (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/models/webpack-config.js:27:37)
at Class.run (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/tasks/serve.js:37:98)
at check_port_1.checkPort.then.port (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/commands/serve.js:103:26)
at process._tickCallback (internal/process/next_tick.js:109:7)
Chriss-iMac:dnd-test christarasovs$ ng build
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8980:109)
at parseSourceFileWorker (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8940:26)
at Object.parseSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8899:26)
at Object.createSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:8727:29)
at WebpackCompilerHost.getSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/@ngtools/webpack/src/compiler_host.js:210:27)
at findSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45859:29)
at processSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45790:27)
at /Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45901:17
at Object.forEach (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:1115:30)
at processReferencedFiles (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45899:16)
at findSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45884:21)
at processSourceFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45790:27)
at processRootFile (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45694:13)
at /Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45151:60
at Object.forEach (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:1115:30)
at Object.createProgram (/Users/christarasovs/Desktop/dnd-test/node_modules/typescript/lib/typescript.js:45151:16)
at AotPlugin._setupOptions (/Users/christarasovs/Desktop/dnd-test/node_modules/@ngtools/webpack/src/plugin.js:124:28)
at new AotPlugin (/Users/christarasovs/Desktop/dnd-test/node_modules/@ngtools/webpack/src/plugin.js:23:14)
at _createAotPlugin (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/models/webpack-configs/typescript.js:55:12)
at Object.exports.getNonAotConfig (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/models/webpack-configs/typescript.js:70:19)
at NgCliWebpackConfig.buildConfig (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/models/webpack-config.js:27:37)
at Class.run (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/tasks/build.js:26:92)
at Class.run (/Users/christarasovs/Desktop/dnd-test/node_modules/@angular/cli/commands/build.js:143:26)
at Class.
@ChrisTarasovs can you read this tread please because as said you can find error using this adivce
Adding a console.log(fileName) in the beginning of the createSourceFile function at node_modules/typescript/lib/typescript.js helped me pinpoint the specific file.
Thank you @istiti I did read and tried several time what was said. So above function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { I have added console.log(fileName); on line 8724 , right above the function and tried inside the function also.
but than I run ng serve and I get the same issue as I get just the same error. Don't seem to understand how you can get the ouput of console.log if that is shown in the browser but I can even load the page?
Currently I got fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" Cannot read property 'length' of undefined TypeError: Cannot read property 'length' of undefined at createSourceFile (C:\Users\ctarasovs\AppData\Roaming\npm\node_modules\ang ular-cli\node_modules\typescript\lib\typescript.js:8980:109) at parseSourceFileWorker (C:\Users\ctarasovs\AppData\Roaming\npm\node_module s\angular-cli\node_modules\typescript\lib\typescript.js:8940:26) at Object.parseSourceFile (C:\Users\ctarasovs\AppData\Roaming\npm\node_modul es\angular-cli\node_modules\typescript\lib\typescript.js:8899:26) at Object.createSourceFile (C:\Users\ctarasovs\AppData\Roaming\npm\node_modu les\angular-cli\node_modules\typescript\lib\typescript.js:8727:29) .....
@ChrisTarasovs your console.log in this file input in your command line not browser what's your ts version ? give your package.json
@istiti sure, here is angular-cli.json and package.json
package.json { "name": "testing", "version": "0.0.0", "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "start": "ng serve", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" }, "private": true, "dependencies": { "@angular/common": "^2.3.1", "@angular/compiler": "^2.3.1", "@angular/core": "^2.3.1", "@angular/forms": "^2.3.1", "@angular/http": "^2.3.1", "@angular/platform-browser": "^2.3.1", "@angular/platform-browser-dynamic": "^2.3.1", "@angular/router": "^3.3.1", "core-js": "^2.4.1", "rxjs": "^5.2.0", "ts-helpers": "^1.1.1", "typescript": "^2.0.10", "zone.js": "^0.7.7" }, "devDependencies": { "@angular/compiler-cli": "^2.3.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "1.0.0-beta.28.3", "codelyzer": "~2.0.0-beta.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "~4.0.13", "ts-node": "1.2.1", "tslint": "^4.3.0", "typescript": "~2.0.3" } }
angular-cli.json { "project": { "version": "1.0.0-beta.28.3", "name": "testing" }, "apps": [ { "root": "src", "outDir": "dist", "assets": [ "assets", "favicon.ico" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "app", "styles": [ "styles.css" ], "scripts": [], "environments": { "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } } ], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, "lint": [ { "files": "src/*/.ts", "project": "src/tsconfig.json" }, { "files": "e2e/*/.ts", "project": "e2e/tsconfig.json" } ], "test": { "karma": { "config": "./karma.conf.js" } }, "defaults": { "styleExt": "css", "prefixInterfaces": false, "inline": { "style": false, "template": false }, "spec": { "class": false, "component": true, "directive": true, "module": false, "pipe": true, "service": true } } }
@istiti Just to let you know that I am trying this on OS and Win system On OS I have setup with @angular 2.4.8 and on Win I have setup the latest 2.4.9
Here is the exact steps I tried
Currently with the files above here is my win setup also >npm --version 4.1.2
>ng --version angular-cli: 1.0.0-beta.28.3 node: 7.7.1 os: win32 x64 @angular/common: 2.4.9 @angular/compiler: 2.4.9 @angular/core: 2.4.9 @angular/forms: 2.4.9 @angular/http: 2.4.9 @angular/platform-browser: 2.4.9 @angular/platform-browser-dynamic: 2.4.9 @angular/router: 3.4.9 @angular/compiler-cli: 2.4.9
@ChrisTarasovs I think the lib you are trying to clone
and you can't juste clone everything inside src/app and expect it to works but at-least i expect it to build or compile. Using my json file did u have success to setup ?
anyone solved this?
I'm still getting this error. On my computer it works fine, but when I push it to Heroku, I gives this error. I can't use the approach to console.log the fileName on typescript package because heroku always installs everything again. It worked fine until my last build to heroku (a week ago)
sorry, my bad! after last build, I had installed typings packages, and not saved in typings.json. typescript could not find the definitions
This error seem to have different reasons and different solutions. In my case I had a reference ///<reference path="..\..\..\typings\globals\google.maps\index.d.ts" />
pointing to a file that did not exist.
I fixed this by making sure my main
property pointed to my main.ts
relative to the root
property. Since my root
is set to src
and main.ts
is at src/app/main.ts
I changed my main
property to app/main.ts
.
@brettatoms, thanks, your solution did the work
@brettatoms. Thanks your solution worked for me with an Ionic 2 project.
Regarding the "missing d.t.s file" issue: can this be reported by Angular CLI and printed to console? Is it possible or should the warning be printed by tsc
?
Thanks a lot @brettatoms that seemed to fix my problem.
Having looked at my .angular-cli.json
file.
I noticed that the environment.prod.ts
and environment.dev.ts
files were missing. Adding these files in has fixed this for me.
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.dev.ts",
"prod": "environments/environment.prod.ts"
}
(on existing project, on windows10) After updating :
I get this insignifiant message error when running
ng serve
orng build
:What does this mean ?