question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'version' of null

See original GitHub issue

Hello all, I’ve been getting this error lately when opening/saving ts files :

Search path: /Users/julien/Documents/web/faucon-rouge/client/apps/front-app/src/app/pages/articles-page
Failed to read JSON file /Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/common/locales/fr.metadata.json
Config file name: /Users/julien/Documents/web/faucon-rouge/client/tsconfig.json
Angular Language Service: 5.0.1
TypeScript: 2.4.2
Error for getTemplateRefrences:
    TypeError: Cannot read property 'version' of null
    at readMetadataFile (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:38646:28)
    at readMetadata (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:38615:25)
    at ReflectorHost.getMetadataFor (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:56526:16)
    at StaticSymbolResolver.getModuleMetadata (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:31804:62)
    at StaticSymbolResolver.hasDecorators (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:31531:46)
    at analyzeFile (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:30078:63)
    at visitFile (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:30057:45)
    at /Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:30063:52
    at Array.forEach (native)
    at _analyzeFilesIncludingNonProgramFiles (/Users/julien/Documents/web/faucon-rouge/client/node_modules/@angular/language-service/bundles/language-service.umd.js:30063:15)
getTemplateRefrences: 367ms
SERVER ERROR: Cannot read property 'length' of null
TypeError: Cannot read property 'length' of null
    at Project.updateFileMap (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:797:94)
    at Project.updateGraph (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:815:14)
    at Project.finishGraph (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:807:14)
    at ProjectService.openConfigFile (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1634:17)
    at ProjectService.openOrUpdateConfiguredProjectForFile (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1486:41)
    at ProjectService.openClientFile (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1404:23)
    at /Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/documents.js:135:47
    at TextDocuments.logErrors (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/documents.js:235:13)
    at /Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/documents.js:131:74
    at handleNotification (/Users/julien/.vscode/extensions/Angular.ng-template-0.1.7/server/node_modules/vscode-jsonrpc/lib/main.js:353:21)
[Error - 23:07:46] Notification handler 'textDocument/didOpen' failed with message: Cannot read property 'length' of null

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:14
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
smasalacommented, Dec 8, 2017

Temp workaround:

Replace the contents of the server folder in your vscode Angular.ng-template-0.1.7 extension with the files out of the repo:

https://github.com/smasala/angular-language-service-0.17.patch

You’ll usually find your extension folder in Windows under: C:\Users\[username]\.vscode\extensions\Angular.ng-template-0.1.7

5reactions
FdezRomerocommented, Nov 25, 2017

This bug is super annoying and it’s not getting any attention for quite some time… 😢

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cordova Android build error “Cannot read property 'version' of ...
I have the latest version of cordova, gradle and the Java 8 JDK installed. And all the environments are set. I have no...
Read more >
npm@5 TypeError: Cannot read property 'version' of null #298
I think this is due to npm5 using a URL value for the version property in package.json files now. There's a hint in...
Read more >
Pbiviz Start - Cannot read property 'version' of null
The directory I am in is my new project one and I receive the following errors: info Installing API: ~2.6.0... error npm install...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
All this means is that you are trying to access a property of an object that is undefined. These usually happens when we...
Read more >
npm install cannot read properties of null (reading 'children')
The error message means that npm is trying to read the version property of the folder's package.json file but doesn't find the file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found