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

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

Open
amir-nazdaq opened this issue Jan 24, 2024 · 0 comments

Comments

@amir-nazdaq
Copy link

amir-nazdaq commented Jan 24, 2024

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant