cyntler / react-doc-viewer

File viewer for React.

Home Page:https://cyntler.github.io/react-doc-viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we please upgrade to latest react-pdf version

xiaolongkipsi opened this issue · comments

Also, there is a breaking change as the code includes pdf-worker.min.js instead of the breaking change pdf-worker-min.mjs

As the dependency is react-pdf@latest it automatically installs version 9.0.0 as a dependency and doesn't work.

@xiaolongkipsi @stefan1968 v1.16.0 is experimental version with a lot of changes - especially about 9.0.0 of react-pdf upgrade. If you can, you can check if it is fine.

@cyntler I tried, I am using it in nextjs. but hitting below error:

Error: Cannot find module '/Users/xiaolongjiang/Documents/workspace/tax/node_modules/@cyntler/react-doc-viewer/dist/esm/DocViewer' imported from /Users/xiaolongjiang/Documents/workspace/tax/node_modules/@cyntler/react-doc-viewer/dist/esm/index.js

It's also failing when doing yarn build

Collecting page data ...Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/xiaolongjiang/Documents/workspace/tax/node_modules/@cyntler/react-doc-viewer/dist/esm/DocViewer' imported from /Users/xiaolongjiang/Documents/workspace/tax/node_modules/@cyntler/react-doc-viewer/dist/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap. (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/xiaolongjiang/Documents/workspace/tax/node_modules/@cyntler/react-doc-viewer/dist/esm/DocViewer'
}

@xiaolongkipsi Hmm, I tried to run it locally with Next.js and it is working.

@xiaolongkipsi Yes. I can. Check it: https://github.com/cyntler/react-doc-viewer/blob/main/use-cases/nextjs/src/app/page.tsx. I installed officially deployed version of this library and it is still working fine as expected.

@xiaolongkipsi Can you provide me more informations about your environment?
I mean:

  • Node.js & npm versions
  • Your package manager (npm/yarn/pnpm)?
  • Next.js version

same error here, for 1.16.0 and 1.16.1
next v13.4.7
yarn v3.8.1
node v20.12.2

I am getting same error:
node: v20.11.1
npm: 10.8.1

@jcvegan @emikira @xiaolongkipsi Please check the latest version: 1.16.2. I migrated to Vite build/compilation system instead of pure TS..

I got the same [ERR_MODULE_NOT_FOUND] error in v1.16.1
1.16.2 fixes the error for my project , thank you very much @cyntler