Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nextjs v15.1.6 module not found #242

Open
tarjelavik opened this issue Jan 27, 2025 · 1 comment
Open

Nextjs v15.1.6 module not found #242

tarjelavik opened this issue Jan 27, 2025 · 1 comment

Comments

@tarjelavik
Copy link

I have upgraded an older next.js site to the latest v15.1.6 version. I had many struggles with i18n and next-intl, but i think i maybe found a bug with clover-iiif.

I have no idea why, but i can document my recreation (https://github.com/tarjelavik/clover-iiif-debug):

npx create-next-app@latest clover-iiif-debug --use-npm
cd clover-iiif-debug
npm i next-intl @samvera/clover-iiif

I installed next-intl as i though that it messed up, but that seemed to not have any influence on the issue.

./node_modules/@samvera/clover-iiif/dist/index.mjs:6:1
Module not found: Can't resolve './helpers'
  4 | import Slider from "./slider";
  5 | import Viewer from "./viewer";
> 6 | import Helpers from "./helpers";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  7 |
  8 | export {
  9 |   Image,

https://nextjs.org/docs/messages/module-not-found

FIx

In the end downgrading next and react to v14 and v18 is a possible fix.

@tarjelavik
Copy link
Author

tarjelavik commented Jan 31, 2025

Investigated further. Changing the import solved it, x.default.

const Viewer = dynamic(
  // () => import("@samvera/clover-iiif").then((Clover) => Clover.Viewer), // works in Next v14, not in v15
  () => import("@samvera/clover-iiif/viewer").then((Clover) => Clover.default),
  {
    ssr: false,
  }
);

I guess something can be done to make it behave the same in v14 and v15, else an update to the docs could mention this difference?

Update: i see this already was discovered by @brogr: #234. Should have paid more attention to the other issues, sry.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant