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

import pdfjs from 'pdfjs-dist' no longer works #12389

Closed
johnwillyn opened this issue Sep 18, 2020 · 4 comments
Closed

import pdfjs from 'pdfjs-dist' no longer works #12389

johnwillyn opened this issue Sep 18, 2020 · 4 comments

Comments

@johnwillyn
Copy link

I have been using this line in two places in my app; one is the main webpack app, and the other is a rollup based module:

import pdfjs from 'pdfjs-dist';

I just got an update to pdfjs-dist v2.5.207 and this no longer works.

I needed to switch over to:

const pdfjs = require('pdfjs-dist');

Not a huge issue, but I thought this might help others who encounter this.

@timvandermeij
Copy link
Contributor

timvandermeij commented Sep 18, 2020

I don't think we changed anything in this regard in that particular version. As far as I can tell this has already been the case for quite some time; notice the Webpack example at

var pdfjsLib = require("pdfjs-dist");
for example. In any case, I think your switch is correct.

@francofantini
Copy link

I'm having the same issue, import was working fine on 2.3.200 but not on 2.5.207.

@arelaxend
Copy link

Not working

@xitanggg
Copy link

xitanggg commented Dec 26, 2022

It seems default import doesn't work, it works with namespace import import * as pdfjs from 'pdfjs-dist';.

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

No branches or pull requests

5 participants