Skip to content

tzachbon/swr-mf-error

Repository files navigation

Minimal project to find the bug with Module Federation (SharePlugin) and SWR

When use swr/infinite with swr>1.1.2 dependency and sharing it with Module Federation (SharePlugin)

    new webpack.container.ModuleFederationPlugin({
      shared: ['swr'],
    }),

We encountered this error:
with-mf

Everything works fine when we remove swr from the shared array.:
without-mf

You can see SWR change log here: https://github.com/vercel/swr/compare/1.1.2...1.2.0

Investigation

About

Uncaught TypeError: useSWR is not a function that is encountered when using Module Federation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors