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.

Cannot read property 'content' of null

See original GitHub issue

Steps to reproduce on Ubuntu 20.04, node 14 (but also tested on node 12 and with angular feature added first to the workspace).

cd /tmp
npx create-nx-workspace myworkspace

choose empty and Nx

cd myworkspace
yarn add --dev @nstudio/xplat
yarn nx generate app

choose mobile, nativescript, Yes, angular, Yes, blah.

You will get Cannot read property 'content' of null.

What am I please doing wrong? Thanks!

Screenshot from 2020-07-21 22-28-27

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
dmitryr117commented, Jul 25, 2020

Ok. To solve this I did a bit of a hack. Before running npx nx generate app I created a tsconfig.json file in the workspace root. The contents are as follows: { "extends": "./tsconfig.base.json" } That’s it. Now when you run npx nx generate app - everything should go smoothly. I tested in with both Angular and Nativescript installations. Seems to work fine. I made an installation youtube video which describes the steps here. https://youtu.be/5imR7aaruTc

0reactions
dmitryr117commented, Jul 24, 2020

Actually scratch that I tested some more, and it seems to be in: ./node_modules/@nstudio/xplat/src/utils/general.js starting at line 81. I added a console.log there. Code like this:

exports.jsonParse = jsonParse;
function getJsonFromFile(tree, path) {
    console.log('General 83', path);
    return jsonParse(tree.get(path).content.toString());

When trying to build a project - I got the following:

? What name would you like for this app? test2 ? What type of app would like to create? web [Web app] ? Would you like to configure routing for this app? Yes General 83 nx.json General 83 package.json ? Which frontend framework should it use? angular [Angular app] ? Use xplat supporting architecture? Yes General 83 nx.json General 83 package.json General 83 package.json General 83 package.json ✔ Packages installed successfully. ? In which directory should the app be generated? ? Which stylesheet format would you like to use? CSS General 83 nx.json General 83 package.json General 83 nx.json General 83 package.json Xplat.js 500 General 83 nx.json General 83 package.json General 83 nx.json General 83 tsconfig.json Cannot read property ‘content’ of null

Looks like a problem with tree and tsconfig.json. In a new version tsconfig.json at workspace root is renamed to tsconfig.base.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
"Cannot read property 'content' of null": Psuedo Elements
I'm getting a "cannot read property 'content' of null error, implying there's something wrong with the DOM call. The code involves adding ...
Read more >
TypeError: Cannot read property 'value' of Null in JS
To solve the "Cannot read property 'value' of null" error, make sure that the JS script tag is placed at the bottom of...
Read more >
vue-loader error with script setup: Cannot read property ...
This seems to be caused by an outdated version of eslint-plugin-vue . Please update it to the latest version.
Read more >
Cannot read property 'content' of null - components - Vue Forum
Hello! Here is my Button.vue component (css hidden): <template> <input :type="type" :class="is" :value="text" @click="click" /> </template> ...
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