Skip to content

Angular version: 16.2.5, Error: __webpack_require__.O is not a function #50

Open
@amir-nazdaq

Description

@amir-nazdaq

I followed the steps described in https://www.angulararchitects.io/en/blog/dynamic-module-federation-with-angular-2/
But when running my application I get this error in DevTools:

main.ts:7 error TypeError: __webpack_require__.O is not a function
    at main.ts:7:43
    at webpackJsonpCallback (jsonp chunk loading:71:1)
    at Array.forEach (<anonymous>)
    at jsonp chunk loading:85:1
    at jsonp chunk loading:86:1

My main.ts in SHELL module:

import { loadRemoteEntry } from '@angular-architects/module-federation-runtime';

Promise.all([
  loadRemoteEntry({ type: 'module', remoteEntry: 'http://localhost:9001/remoteEntry.js'})
])
.then(() => import('./bootstrap'))
.catch(err => console.error('error', err));

package.json :

    "@angular-architects/module-federation": "^16.0.4",
    "@angular/animations": "16.2.8",
    "@angular/cdk": "16.1.8",
    "@angular/cli": "16.2.5",
    "@angular/common": "16.2.8",
    "@angular/compiler": "16.2.8",
    "@angular/core": "16.2.8",
    "@angular/forms": "16.2.8",
    "@angular/material": "16.1.8",
    "@angular/platform-browser": "16.2.8",
    "@angular/platform-browser-dynamic": "16.2.8",
    "@angular/router": "16.2.8",
    "@apollo/client": "3.8.5",
    "@ngrx/effects": "16.3.0",
    "@ngrx/entity": "16.3.0",
    "@ngrx/store": "16.3.0",
    "@ngrx/store-devtools": "16.3.0",
    ...
    ...
    ...
    ...
    "webpack": "5.89.0",
    "webpack-cli": "5.1.4",
    "webpack-dev-server": "4.7.1",
    "zone.js": "0.13.0"

@manfredsteyer
What's the cause of this? ( I can provide more code if anything else is required )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions