This means the browser wont know what you mean with the require() call in your code. Why is proving something is NP-complete useful, and where can I use it? With respect to Global PDFJS being removed in future versions: Babel 6 regeneratorRuntime is not defined. How can I ensure below code works with V1.5? Why does it matter that a group of January 6 rioters went to Olive Garden for dinner after the riot? } See if you have a type: module defined in your JSON file as shown below: The module type is used to make Node treat .js files as ES modules. require([ //This does not work, even though "pdf.worker.js" is in the same path. }); To add it to your project, you need to download the latest RequireJS release and put it in your scripts/ folder.