mikecousins/react-pdf-js

CSP Issue with evaled code in pdfjs

Closed this issue · 2 comments

image

It is working fine with the deprecated version 5.1.0

The error is from the pdf.js bundle.

try {
  regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
  Function("r", "regeneratorRuntime = r")(runtime);
}

Package.json

  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "electron-dev": "webpack --config webpack.electron.js --watch",
    "electron-build": "webpack --config webpack.electron.js",
    "electron-start": "electron .",

"devDependencies": {
    "@babel/core": "^7.11.1",
    "@babel/plugin-transform-runtime": "^7.11.5",
    "@babel/preset-env": "^7.11.0",
    "@babel/preset-react": "^7.10.4",
    "@electron-forge/cli": "^6.0.0-beta.54",
    "@electron-forge/maker-deb": "^6.0.0-beta.54",
    "@electron-forge/maker-rpm": "^6.0.0-beta.54",
    "@electron-forge/maker-squirrel": "^6.0.0-beta.54",
    "@electron-forge/maker-zip": "^6.0.0-beta.54",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.1.0",
    "css-loader": "^4.2.1",
    "electron": "^10.3.2",
    "electron-reload": "^1.5.0",
    "eslint": "^7.19.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "webpack": "^4.44.1",
    "webpack-cli": "^3.3.12"
  },
  "dependencies": {
    "@date-io/date-fns": "^1.3.13",
    "@material-ui/core": "^4.11.0",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "^4.0.0-alpha.56",
    "@material-ui/pickers": "^3.2.10",
    "@mikecousins/react-pdf": "^5.5.1",
    "axios": "^0.21.1",
    "clsx": "^1.1.1",
    "date-fns": "^2.0.0-beta.5",
    "electron-squirrel-startup": "^1.0.0",
    "file-loader": "^6.2.0",
    "formik": "^2.2.6",
    "jspdf": "^2.2.0",
    "material-ui-file-dropzone": "^0.2.0",
    "mobx": "^6.0.1",
    "mobx-react-lite": "^3.0.0",
    "node-sass": "^4.14.1",
    "prop-types": "^15.7.2",
    "react": "^17.0.1",
    "react-detect-offline": "^2.4.1",
    "react-dom": "^17.0.1",
    "react-number-format": "^4.4.4",
    "react-router-dom": "^5.2.0",
    "react-webcam": "^5.2.2",
    "sass-loader": "^10.1.0",
    "style-loader": "^1.2.1",
    "url-loader": "^4.1.1",
    "uuid": "^8.3.2",
    "yup": "^0.32.8"
  },

@mikecousins

Let me know if this is still happening in the new version.

Let me know if this is still happening in the new version.

No, It's not happening for latest versions. Thanks @mikecousins for the effort..