Code Monkey home page Code Monkey logo

docusaurus-plugin-react-pdf's Introduction

@syed-ahmed/docusaurus-plugin-react-pdf

Docusaurus Plugin to render PDF as images using react-pdf.

Installation

yarn add @syed-ahmed/docusaurus-plugin-react-pdf

Modify your docusaurus.config.js

module.exports = {
  ...
+ plugins: ['@syed-ahmed/docusaurus-plugin-react-pdf'],
  ...
}

Usage

import ReactPdf from '@syed-ahmed/docusaurus-plugin-react-pdf/lib/theme/ReactPdf';

<ReactPdf pdf={require('./path/to/doc.pdf').default}/>

docusaurus-plugin-react-pdf's People

Contributors

syed-ahmed avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

docusaurus-plugin-react-pdf's Issues

Cannot read properties of undefined (reading 'current')

Hi,

I would like to use your software, but I'm encountering this error. Would you be able to help?

I have attached .zip of an example website.
my-website 2.zip

npx create-docusaurus@latest my-website classic --typescript
npm add @syed-ahmed/docusaurus-plugin-react-pdf
modified intro page and config according to .zip 
Error: Docusaurus server-side rendering could not render static page with path /docs/intro because of error: Cannot read properties of undefined (reading 'current')
    at serverEntry_render (main:45403:358)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at process.processImmediate (node:internal/timers:449:9)
    at async /Users/davidebortolami/Downloads/my-website/node_modules/p-map/index.js:57:22 {
  [cause]: TypeError: Cannot read properties of undefined (reading 'current')
      at ReactPdf (main:3338:452)
      at Uc (main:89772:44)
      at Xc (main:89774:253)
      at Z (main:89780:89)
      at Yc (main:89783:98)
      at $c (main:89782:140)
      at Z (main:89780:345)
      at Xc (main:89775:476)
      at Z (main:89780:89)
      at Xc (main:89774:481)
}

Error: Unable to build website for locale en.
    at tryToBuildLocale (/Users/davidebortolami/Downloads/my-website/node_modules/@docusaurus/core/lib/commands/build.js:55:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async mapAsyncSequential (/Users/davidebortolami/Downloads/my-website/node_modules/@docusaurus/utils/lib/jsUtils.js:44:24)
    at async Command.build (/Users/davidebortolami/Downloads/my-website/node_modules/@docusaurus/core/lib/commands/build.js:82:21) {
  [cause]: Error: Failed to compile due to Webpack errors.
  Error: Docusaurus server-side rendering could not render static page with path /docs/intro because of error: Cannot read properties of undefined (reading 'current')
      at /Users/davidebortolami/Downloads/my-website/node_modules/@docusaurus/core/lib/webpack/utils.js:207:24
      at /Users/davidebortolami/Downloads/my-website/node_modules/webpack/lib/MultiCompiler.js:554:14
      at processQueueWorker (/Users/davidebortolami/Downloads/my-website/node_modules/webpack/lib/MultiCompiler.js:491:6)
      at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.