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.

Consistent failure migrating from 12.0.8 to 12.1.0 or later

See original GitHub issue

Current Behavior

I am seeing a consistent failure when migrating from 12.0.8 to 12.1.0 or later.

Cannot convert undefined or null to object

(full error below)

  • I’ve tried migrating to latest, 12.4.0, 12.3.6, 12.3.0 and 12.1.0.
  • As one issue suggested, I have tried after deleting node_modules and package-lock.json
  • As another issue suggested, I have verified that all projects have an architect key in angular.json
    • (fwiw there was a single project that was missing this but I added it in and the migration still fails)
  • As another issue suggested, I verified that tsconfig.base.json has a paths key.
  • As another issue suggested, I verified that the base package.json has a dependencies key.

I have hit NX upgrade snags before but have been able to figure out a way around them but this time I’m a bit out of my depth.

Expected Behavior

Obviously the expected behavior is a successful upgrade 🙃

Steps to Reproduce

As I cannot reproduce this outside of our repo, I hesitate to call this a bug. But I am hoping someone can help point me in a better direction.

Failure Logs

Error output
Running migration update-12-1-0
admin: no storybook configured. skipping migration...
analytics: no storybook configured. skipping migration...
animations: no storybook configured. skipping migration...
auth: no storybook configured. skipping migration...
brochure: no storybook configured. skipping migration...
dao: no storybook configured. skipping migration...
cards: no storybook configured. skipping migration...
claim-account: no storybook configured. skipping migration...
claim-invite: no storybook configured. skipping migration...
config: no storybook configured. skipping migration...
core: no storybook configured. skipping migration...
cypress: no storybook configured. skipping migration...
layouts: no storybook configured. skipping migration...
order-checks: no storybook configured. skipping migration...
pipes: no storybook configured. skipping migration...
portal: no storybook configured. skipping migration...
postcss-themes: no storybook configured. skipping migration...
shared: no storybook configured. skipping migration...
Cannot convert undefined or null to object
/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/workspace/node_modules/yargs/build/lib/yargs.js:1132
                throw err;
                ^

Error: Command failed: /var/folders/37/98bg5khn7_30nfbbwc6yb1g40000gn/T/tmp-77773-XZq4fTc6xGC6/node_modules/.bin/tao migrate --run-migrations
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at Object.handler (/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:90:25)
    at Object.runCommand (/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/workspace/node_modules/yargs/build/lib/command.js:196:48)
    at Object.parseArgs [as _parseArgs] (/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/workspace/node_modules/yargs/build/lib/yargs.js:1043:55)
    at Object.get [as argv] (/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/workspace/node_modules/yargs/build/lib/yargs.js:986:25)
    at Object.initLocal (/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/cli/lib/init-local.js:26:79)
    at Object.<anonymous> (/Users/benjamin.charity/code/apiture/web/node_modules/@nrwl/cli/bin/nx.js:43:18)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 77811,
  stdout: null,
  stderr: null
}

Environment

NX Report
  Node : 12.18.3
  OS   : darwin x64
  npm  : 6.14.6

  nx : Not Found
  @nrwl/angular : 12.1.0
  @nrwl/cli : 12.1.0
  @nrwl/cypress : 12.1.0
  @nrwl/devkit : 12.1.0
  @nrwl/eslint-plugin-nx : 12.1.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.1.0
  @nrwl/linter : 12.1.0
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 12.1.0
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.1.0
  @nrwl/web : Not Found
  @nrwl/workspace : 12.1.0
  @nrwl/storybook : 12.1.0
  @nrwl/gatsby : Not Found
  typescript : 4.0.5

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
kpaxtoncommented, Jul 1, 2021

Just did some debugging on this myself. In my case I had a project listed in the angular.json that did not have an architect property.

"styles": {
      "root": "libs/styles",
      "sourceRoot": "libs/styles/src",
      "projectType": "library",
    -->  "architect": {} // this seems to be required for certain migrations to work since it's looping through the 'targets' and without it, 'targets' is null.
    }

just adding architect:{} solved it for me to all projects that were missing them.

0reactions
ivanjicommented, Jul 17, 2021

You’re right - when I removed this library from the workspace, updating to the latest version worked! But how am I supposed to have stylesheets only libraries in my project which don’t need targets? Probably, adding a fix for this like you suggested for this type of situations would help. Or could you suggest an alternative? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade Guide - Next.js
Upgrade Guide. Upgrading from 12 to 13. To update to Next.js version 13, run the following command using your preferred package manager:
Read more >
Oracle JET Application Migration for Release 12.1.0
If you used Oracle JET tooling to scaffold your application with Oracle JET version 5.x.0 or later, you can migrate your application manually...
Read more >
OpenProject 12.1.0
Open source project management software for classic, agile or hybrid project management: task management✓ Gantt charts✓ boards✓ team ...
Read more >
GoodSync Version News- Mac
Update news for GoodSync for Mac file sync and backup software. Check back often to get the most up-to-date information on new and...
Read more >
ChangeLog: Standard Release Version 12.5.11 ... - REDCap
Bug fix: A calculation error might occur on a data entry form or survey ... Bug fix: When upgrading to REDCap 12.1.0 or...
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