reactjsmicro-frontendwebpack-module-federationangular-module-federationnextjs-mf

lib folder is not present inside the '@module-federation/nextjs-mf?


Hi i am trying to make use of micro front end in nextjs , So as mentioned in this npm pkg link ,

lib folder is not present inside the @module-federation package

tried below way to import the include-defaults

import '@module-federation/nextjs-mf/lib/include-defaults'

but it throws the below error

Module not found: Can't resolve '@module-federation/nextjs-mf/lib/include-defaults'
import App, { AppContext as NextAppContext } from 'next/app'
import '@module-federation/nextjs-mf/lib/include-defaults'

Solution

  • We can find files inside the src folder, So we can point src like below

    import '@module-federation/nextjs-mf/src/include-defaults'
    

    This will importing lib as expected ,

    ** Note but i am not sure , why the lib folder and its files are not there in the package