Describe the bug
Error occurring using App router (NextJS v14)
Failed to generate static paths for /projects/[slug]:
TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
at eval (webpack-internal:///(rsc)/./node_modules/react-photoswipe-gallery/dist/context.js:7:83)
Code example
// FILE: src/components/Gallery/index.tsx
export { Gallery, Item } from "react-photoswipe-gallery";
Attempted Fix
Setting "use client", causes a different error
Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".
<... original=... thumbnail=... width=... height=... caption=... children={function}>
// FILE: src/components/Gallery/index.tsx
"use client";
export { Gallery, Item } from "react-photoswipe-gallery";
// FILE: src/app/posts/[slug/]page.tsx
... same as above
Describe the bug Error occurring using App router (NextJS v14)
Code example // FILE: src/components/Gallery/index.tsx
export { Gallery, Item } from "react-photoswipe-gallery";
// FILE: src/app/posts/[slug/]page.tsx
Attempted Fix Setting "use client", causes a different error
// FILE: src/components/Gallery/index.tsx
// FILE: src/app/posts/[slug/]page.tsx
... same as above
Any suggestions what could be a solution please?