You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm asking because doing this const useSWR = require("swr") leads to useSWR is not a function. I already saw a thread related to this, but I couldn't find a way around this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'd like to know if CommonJS is supported by SWR.
I'm asking because doing this
const useSWR = require("swr")
leads touseSWR is not a function
. I already saw a thread related to this, but I couldn't find a way around this.For instance, modifying your basic example application from https://swr.vercel.app/es-ES/examples/basic by converting it to CommonJS leads to this issue:
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions