Skip to content

class extend value undefined is not a constructor or null #20380

@Sreevedvp

Description

@Sreevedvp

Bug Description

Bug Description
Unable to serve the build which is been created with module federation.

Version used
"@angular-architects/module-federation": "^20.0.0", "@angular/common": "^20.1.0", "@angular/compiler": "^20.1.0", "@angular/core": "^20.1.0",
Angular Json
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "dashboard-v2": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-builders/custom-webpack:browser", "options": { "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ { "glob": "**/*", "input": "public", "output": "." } ], "styles": [ "src/styles.scss" ], "main": "src/main.ts", "outputPath": "dist/dashboard-v2", "index": "src/index.html", "customWebpackConfig": { "path": "webpack.config.js" }, "polyfills": [ "zone.js" ] }, "configurations": { "production": { "budgets": [ { "type": "initial", "maximumWarning": "500kB", "maximumError": "1MB" }, { "type": "anyComponentStyle", "maximumWarning": "4kB", "maximumError": "8kB" } ], "outputHashing": "all" }, "development": { "optimization": false, "extractLicenses": false, "sourceMap": true } }, "defaultConfiguration": "production" }, "serve": { "builder": "@angular-builders/custom-webpack:dev-server", "configurations": { "production": { "buildTarget": "dashboard-v2:build:production" }, "development": { "buildTarget": "dashboard-v2:build:development" } }, "defaultConfiguration": "development", "options": { "port": 4442, "publicHost": "http://10.**.**.**:4442" } }, "extract-i18n": { "builder": "@angular-builders/custom-webpack:extract-i18n" }, "test": { "builder": "@angular/build:karma", "options": { "tsConfig": "tsconfig.spec.json", "inlineStyleLanguage": "scss", "assets": [ { "glob": "**/*", "input": "public" } ], "styles": [ "src/styles.scss" ], "polyfills": [ "zone.js", "zone.js/testing" ] } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { "lintFilePatterns": [ "src/**/*.ts", "src/**/*.html" ] } } } } }, "cli": { "analytics": false, "schematicCollections": [ "angular-eslint" ] } }

webpack.config.js

`const { shareAll, withModuleFederationPlugin } = require('@angular-architects/module-federation/webpack');
const env = require('./public/assets/architectural_config/environment.json');

module.exports = withModuleFederationPlugin({

remotes: {
"EquipmentApp": ${env.remoteUrl}/remoteEntry.js,
},

shared: {
...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto' }),
'at-yard-lib': {
singleton: true,
strictVersion: false, // Changed to false
requiredVersion: 'auto', // Added this
eager: false // Added this to ensure proper loading
},
'atai-angular-library-v2': {
singleton: true,
strictVersion: false, // Changed to false
requiredVersion: 'auto', // Added this
eager: true // Added this
},
},

});`

NOTE:- this issue is only came to the sight into multiple application using similar specification and packages 5-6 days before once we have cleaned installed it.

Link to Minimal Reproduction and step to reproduce

run the build comand and serve the build.

Expected Behavior

Build runs perfectly

Actual Behavior

Image

Environment

intel i7 4th gen
32gb ram

Is this a regression?

None

Last Working Version

No response

Additional Context

I have tried with diffrent builders like ngx-build-plus also but its not working

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions