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

Upgrading to V9 gives: "Class extends value undefined is not a constructor or null" #5197

Closed
IonelLupu opened this issue May 4, 2020 · 4 comments

Comments

@IonelLupu
Copy link

IonelLupu commented May 4, 2020

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start-wen6uj

Steps to reproduce

ng update ng-zorro-antd

What is expected?

The upgrade to finish successfully

What is actually happening?

Receiving this error instead: "An unhandled exception occurred: Class extends value undefined is not a constructor or null".

Environment Info
ng-zorro-antd 9.1.0
Browser CLI

I saw people saying that it might be due to circular dependencies but the app is working fine.

These are the logs for the error:

[error] TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Users\<user name>\Desktop\Work\<project name>\node_modules\ng-zorro-antd\schematics\ng-update\upgrade-rules\checks\calendar-input-rule.js:4:49)

These are the contents of the calendar-input-rule.js file:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular/cdk/schematics");
class CalendarTemplateRule extends schematics_1.MigrationRule {
    constructor() {
        super(...arguments);
        this.ruleEnabled = this.targetVersion === schematics_1.TargetVersion.V9;
    }
    visitTemplate(template) {
        schematics_1.findInputsOnElementWithTag(template.content, 'nzCard', ['nz-calendar'])
            .forEach(offset => {
            this.failures.push({
                filePath: template.filePath,
                position: template.getCharacterAndLineOfPosition(offset),
                message: `Found deprecated input "nzCard" component. Use "nzFullscreen" to instead please.`
            });
        });
    }
}
exports.CalendarTemplateRule = CalendarTemplateRule;
//# sourceMappingURL=calendar-input-rule.js.map

I also tried to upgrade an empty Angular 8 app with NG-Zorro 8 to version 9 and I get the same error. One of my colleagues tried to upgrade too, but he got the same error.

@Drackos
Copy link

Drackos commented May 6, 2020

Hello,
I seem to have the same issue. Any updates or can a workaround be provided?

Thank you

@hsuanxyz
Copy link
Member

hsuanxyz commented May 6, 2020

@Drackos @IonelLupu

$ npm i @angular/cdk@9.2.1 --save

Try downgrade @angular/cdk to 9.2.1 until ng-zorro-antd@9.1.1 released.

@IonelLupu
Copy link
Author

IonelLupu commented May 6, 2020

Thank you @hsuanxyz for the workaround. It works for now 😄

@hsuanxyz
Copy link
Member

hsuanxyz commented May 6, 2020

I will reopen it so others can find it.

@hsuanxyz hsuanxyz reopened this May 6, 2020
@NG-ZORRO NG-ZORRO deleted a comment from zorro-bot bot May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants