Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

pdfjs-dist 1.3.94 throwing error #6760

Closed
viz opened this issue Dec 16, 2015 · 9 comments · Fixed by #6764
Closed

pdfjs-dist 1.3.94 throwing error #6760

viz opened this issue Dec 16, 2015 · 9 comments · Fixed by #6764

Comments

@viz
Copy link

viz commented Dec 16, 2015

using react-pdfjs 1.0.1 which has pdfjs-dist as a dependency.

In the last hour pdfjs 1.3.94 was released and I'm now getting:

Uncaught TypeError: Cannot read property 'PDFJS' of undefined

@viz viz changed the title pdfjs-dist 1.3.9 pdfjs-dist 1.3.94 throwing error Dec 16, 2015
@yurydelendik
Copy link
Contributor

@viz Could you post link to the complete example?

@viz
Copy link
Author

viz commented Dec 16, 2015

With irrelevant stuff removed...

import React from 'react';
import { Button, Modal } from 'react-bootstrap';
import PDF from 'react-pdfjs';

const MyLargeModal = React.createClass({
  render() {
    return (
      <Modal {...this.props} aria-labelledby="contained-modal-title-lg">
        <Modal.Header closeButton>
          <Modal.Title id="contained-modal-title-lg">{this.props.title}</Modal.Title>
        </Modal.Header>
        <Modal.Body>
          <PDF file={this.props.sampleUrl} />
        </Modal.Body>
        <Modal.Footer>
          <Button onClick={this.props.onHide}>Close</Button>
        </Modal.Footer>
      </Modal>
    );
  }
});

@viz viz closed this as completed Dec 16, 2015
@viz
Copy link
Author

viz commented Dec 16, 2015

http___localhost_8888_product-list_is_not_available

@viz
Copy link
Author

viz commented Dec 16, 2015

whoops - accidentally closed the issue

@viz viz reopened this Dec 16, 2015
@viz
Copy link
Author

viz commented Dec 16, 2015

Worked previously when pdfjs was at version 1.3.78. Only started to see this problem when we re-installed node modules.

@yurydelendik
Copy link
Contributor

Looks like it's a problem with webpack, and we don't support webpack atm. The snippets above are not really helpful. Can you create a sample project with react-pdfjs 1.0.1 and document steps to reproduce the issue including build steps? This can speed up the issue resolution.

@yurydelendik
Copy link
Contributor

I think the simple way will be to remove UMD headers from the inside of the pdf.js and pdf.xxx.js files.

@viz
Copy link
Author

viz commented Dec 16, 2015

I'll have a look - will try to create a small sample project showing the issue

@rlucha
Copy link

rlucha commented Dec 16, 2015

Last working version for us was 1.3.90.

The only hint I've found is in https://github.com/mozilla/pdfjs-dist/blame/07affac44670de2ec4886d6ffd3f0641c0556f62/build/pdf.js#L38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants