Skip to content

Fix upgrade-packages crash when ignite-ui-cli.json is missing#1690

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-upgrade-packages-error
Draft

Fix upgrade-packages crash when ignite-ui-cli.json is missing#1690
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-upgrade-packages-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

ig upgrade-packages throws Cannot read properties of undefined (reading 'framework') when run in a project without ignite-ui-cli.json, since config.project is undefined when no local config exists.

Changes

  • Auto-detect framework: When config.project.framework is absent, fall back to the existing detectFrameworkFromPackageJson() utility to infer the framework from package.json dependencies
  • Safe property access: Use optional chaining on config.project?.framework, config.project?.projectType, and config.project?.projectTemplate
  • Derive projectType: Map detected framework to its project type (angular→igx-ts, react→igr-ts, webcomponents→igc-ts) when not specified in config
  • Informative error: Log a clear message when neither config nor package.json can determine the framework
// Before: crashes when config.project is undefined
const framework = config.project.framework;

// After: falls back to package.json detection
let framework = config.project?.framework;
if (!framework) {
    const detected = detectFrameworkFromPackageJson();
    if (!detected) {
        Util.log("Unable to determine the project framework. ...", "yellow");
        return;
    }
    framework = detected;
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.google-analytics.com
    • Triggering command: /usr/local/bin/node node packages/cli/bin/execute.js new --help (dns block)
    • Triggering command: /usr/local/bin/node node packages/cli/bin/execute.js config --help (dns block)
    • Triggering command: /usr/local/bin/node node packages/cli/bin/execute.js generate --help (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix ig upgrade-packages error for ignite-ui-cli.json Fix upgrade-packages crash when ignite-ui-cli.json is missing May 15, 2026
Copilot finished work on behalf of kdinev May 15, 2026 10:29
Copilot AI requested a review from kdinev May 15, 2026 10:29
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 87.414% (+0.09%) from 87.329% — copilot/fix-upgrade-packages-error into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ig upgrade-packages throws an error when it doesn't find any ignite-ui-cli.json

3 participants