Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of null (reading 'id') #75

Open
GravlLift opened this issue Oct 9, 2023 · 2 comments
Open

Cannot read properties of null (reading 'id') #75

GravlLift opened this issue Oct 9, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@GravlLift
Copy link

GravlLift commented Oct 9, 2023

Versions v3.20.1 and higher (tested up to v3.20.4) and higher are completely unstartable on my Ubuntu WSL2 machine, resulting in the following output when any command is run (this output is from a simple lando command):

undefined:0


TypeError: Cannot read properties of null (reading 'id')
    at /snapshot/cli/node_modules/@lando/core/lib/bootstrap.js
    at /snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js
    at /snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js
    at baseForOwn (/snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js)
    at /snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js
    at baseMap (/snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js)
    at Function.map (/snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js)
    at interceptor (/snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js)
    at Function.thru (/snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js)
    at /snapshot/cli/node_modules/@lando/core/node_modules/lodash/lodash.js

v3.18.0 of lando still works for me, which claims to be using tag v3.16.0 of @lando/core. Checking the diff of changed lines between that tag and main, only two lines appear to attempt to access an id property, 282 and 286.

core/lib/bootstrap.js

Lines 281 to 287 in 8dc2708

_.forEach(config.tooling, (task, command) => {
if (_.isObject(task) && typeof command === 'string') task.id = task.id || command.split(' ')[0];
});
// If the tooling command is being called lets assess whether we can get away with engine bootstrap level
const ids = _(config.tooling).map(task => task.id).filter(_.identity).value();
const level = (_.includes(ids, argv._[0])) ? getBsLevel(config, argv._[0]) : 'app';

Looks like the culprit is likely line 286 not checking if task is an object before accessing its properties.

@GravlLift GravlLift added the bug Something isn't working label Oct 9, 2023
@pirog
Copy link
Sponsor Member

pirog commented Oct 10, 2023

@GravlLift can you provide a Landofile for us to try and replicate with?

@pirog pirog self-assigned this Oct 10, 2023
@cleverington
Copy link

Seeing the issue similarly on v3.21.8 using the lagoon recipe and the nodebuilder (for uselagoon/node-14-builder) fails to even let the lando info / lando version / lando destroy commands work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants