lens-protocol / lens-sdk

The official SDK to interact with the Lens Protocol
https://docs.lens.xyz/docs/what-is-lens
MIT License
231 stars 72 forks source link

Using LensProvider in a page.js router Next.js project #963

Closed dave4506 closed 1 month ago

dave4506 commented 1 month ago

Describe the bug We use page.js router in our next.js project and have run into issues, we believe related to SSR. All examples provided use app.js and the 'use client' directive, which doesn't work for page.js

To Reproduce CleanShot 2024-08-09 at 12 51 57 Any directions to making the provider work for pages router will be greatly appreciated.

If using the React bindings, what is the essence of your React app?

Version of the packages you are using

    "@lens-protocol/react-web": "^2.3.1",
    "@lens-protocol/wagmi": "^4.1.4",
dave4506 commented 1 month ago

I have tried, but this doesn't work.

export const ClientOnlyLensProvider = dynamic(() => Promise.resolve(LensProvider), {
    ssr: false,
})
dave4506 commented 1 month ago

Closing, it had to do with adding to config file transpilePackages