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 'split' of undefined

See original GitHub issue

Expected Behavior

Hello Brother

I would like to ignore some projects when executing the command `lerna bootstrap`

Current Behavior

Hello Brother

I'm using the model lerna.json

But the error is being returned

When you remove the

"ignore": "component- *",

Works as expected

Possible Solution

Steps to Reproduce (for bugs)

$ lerna ls
lerna notice cli v3.14.1
component-casper-magento
@mozg/crawler-prices
hackathon-casperjs
@mozg/magento-base
@mozg/nodejs-base
@mozg/reactjs-workers
isomorphic-jwt-login
lerna success found 7 packages

$ lerna bootstrap
lerna notice cli v3.14.1
lerna notice filter excluding "component-*"
lerna info filter [ '!component-*' ]
lerna ERR! TypeError: Cannot read property 'split' of undefined
lerna ERR!     at Minimatch.match (/home/marcio/.nvm/versions/node/v12.1.0/lib/node_modules/lerna/node_modules/minimatch/minimatch.js:717:9)
lerna ERR!     at /home/marcio/.nvm/versions/node/v12.1.0/lib/node_modules/lerna/node_modules/minimatch/minimatch.js:691:15
lerna ERR!     at Array.filter (<anonymous>)
lerna ERR!     at Function.minimatch.match (/home/marcio/.nvm/versions/node/v12.1.0/lib/node_modules/lerna/node_modules/minimatch/minimatch.js:690:15)
lerna ERR!     at /home/marcio/.nvm/versions/node/v12.1.0/lib/node_modules/lerna/node_modules/multimatch/index.js:25:33
lerna ERR!     at Array.reduce (<anonymous>)
lerna ERR!     at module.exports (/home/marcio/.nvm/versions/node/v12.1.0/lib/node_modules/lerna/node_modules/multimatch/index.js:17:18)
lerna ERR!     at filterPackages (/home/marcio/.nvm/versions/node/v12.1.0/lib/node_modules/lerna/node_modules/@lerna/filter-packages/filter-packages.js:44:28)
lerna ERR! lerna Cannot read property 'split' of undefined

$ cat lerna.json
{
  "version": "1.1.3",
  "npmClient": "yarn",
  "command": {
    "publish": {
      "ignoreChanges": ["ignored-file", "*.md"],
      "message": "chore(release): publish"
    },
    "bootstrap": {
      "ignore": "component-*",
      "npmClientArgs": ["--no-package-lock"]
    }
  },
  "packages": ["packages/**"]
}

Captura de tela de 2019-06-06 11-10-27 Captura de tela de 2019-06-06 11-10-43

Context

Your Environment

Executable Version
$ lerna --version
3.14.1
$ npm --version
6.9.0
$ yarn --version
1.16.0
$ node --version
v12.1.0
OS Version
| Ubuntu | 18.04 |

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

38reactions
evocateurcommented, Jun 6, 2019

Do all of your leaf packages have a name field in their package.json files?

7reactions
trusktrcommented, Apr 1, 2021

A better error message would be helpful!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent cannot read property split of undefined
This error is a TypeError , and it occurs when calling a method, operand, or argument on the wrong data type, or when...
Read more >
How to Prevent cannot read property split of ... - Gopi Gorantala
The "cannot read property 'split' of undefined" error occurs when trying to call split() method on a variable that stores an undefined value....
Read more >
Cannot Read Property 'split' of Undefined - freeCodeCamp
it will throw the TypeError: Cannot read property 'split' of undefined error. The split method. When split is called on a string, it...
Read more >
Uncaught TypeError: Cannot read property 'split' of undefined
Your question answers itself ;) If og_date contains the date, it's probably a string, so og_date.value is undefined.
Read more >
TypeError: Cannot read property 'split' of undefined - SitePoint
TypeError : Cannot read property 'split' of undefined ... Somebody please guide me. Zulfi. Zulf. ... If you want contractCode2 to be a...
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