pipwerks / PDFObject

A lightweight JavaScript utility for dynamically embedding PDFs in HTML documents.
http://pdfobject.com/
Other
2.4k stars 984 forks source link

Problem with other NPM Modules #245

Closed SheppardX closed 3 years ago

SheppardX commented 3 years ago

as soon as i install pdfobject via npm module i get this error when i am starting my app

Error: node_modules/@nrwl/workspace/src/generators/library/schema.d.ts:1:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

1 const { Linter } = require('@nrwl/linter');
  ~~~~~

Error: node_modules/@nrwl/workspace/src/generators/library/schema.d.ts:1:20 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1 const { Linter } = require('@nrwl/linter');
                     ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@nrwl/workspace/src/generators/library/schema.d.ts:11:12 - error TS2749: 'Linter' refers to a value, but is being used as a type here. Did you mean 'typeof Linter'?

11   linter?: Linter;

if i uninstall it again it works

my package.json

"dependencies": {
    "@agm/core": "^1.1.0",
    "@angular/animations": "^11.2.4",
    "@angular/cdk": "^11.2.3",
    "@angular/common": "^11.2.4",
    "@angular/compiler": "^11.2.4",
    "@angular/core": "^11.2.4",
    "@angular/forms": "^11.2.4",
    "@angular/localize": "^11.2.4",
    "@angular/platform-browser": "^11.2.4",
    "@angular/platform-browser-dynamic": "^11.2.4",
    "@angular/platform-server": "^11.2.4",
    "@angular/router": "^11.2.4",
    "@angular/service-worker": "^11.2.4",
    "@apollo/client": "^3.3.11",
    "@auth0/angular-jwt": "^5.0.2",
    "@capacitor/android": "^2.4.7",
    "@capacitor/cli": "^2.4.7",
    "@capacitor/core": "^2.4.7",
    "@capacitor/ios": "^2.4.7",
    "@ionic-native/browser-tab": "^5.26.0",
    "@ionic-native/core": "^5.26.0",
    "@ionic-native/deeplinks": "^5.26.0",
    "@ionic-native/in-app-browser": "^5.26.0",
    "@ionic-native/native-storage": "^5.26.0",
    "@ionic/angular": "^5.2.3",
    "@ng-bootstrap/ng-bootstrap": "^9.0.2",
    "@ngneat/until-destroy": "^8.0.4",
    "@ngrx/effects": "^11.0.1",
    "@ngrx/router-store": "^11.0.1",
    "@ngrx/store": "^11.0.1",
    "@ngrx/store-devtools": "^11.0.1",
    "@ngx-translate/core": "^11.0.1",
    "@nrwl/workspace": "^11.4.0",
    "@types/googlemaps": "^3.43.3",
    "@types/hammerjs": "^2.0.39",
    "@types/mixpanel-browser": "^2.35.6",
    "@types/pdfobject": "^2.2.0",
    "@types/uuid": "^8.3.0",
    "angular-svg-icon": "^11.2.0",
    "apollo-angular": "^2.4.0",
    "apollo-link-http": "^1.5.9",
    "apollo-server": "^2.21.0",
    "browser-image-compression": "^1.0.12",
    "chart.js": "^2.9.3",
    "color": "^3.1.2",
    "cordova-plugin-browsertab": "^0.2.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-deeplinks": "^1.1.1",
    "cordova-plugin-inappbrowser": "^4.0.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-whitelist": "^1.3.4",
    "core-js": "^2.6.11",
    "cross-fetch": "^3.0.6",
    "eva-icons": "^1.1.2",
    "font-awesome": "^4.7.0",
    "graphql": "^14.6.0",
    "hammerjs": "^2.0.8",
    "ibantools": "^3.3.0",
    "ionic-plugin-deeplinks": "^1.0.20",
    "jasmine-marbles": "^0.8.1",
    "jspdf": "^2.3.1",
    "jwt-decode": "^3.1.2",
    "keycloak-js": "^12.0.4",
    "material-design-icons": "^3.0.1",
    "mixpanel-browser": "^2.34.0",
    "moment": "^2.23.0",
    "ng-gallery": "^5.0.0",
    "ng-gtag": "^10.0.4",
    "ngx-color-picker": "^8.2.0",
    "ngx-iban": "^11.1.1",
    "ngx-perfect-scrollbar": "^8.0.0",
    "ngx-sortablejs": "^11.1.0",
    "pdfobject": "^2.2.5",
    "rimraf": "^2.6.2",
    "rxjs": "^6.6.6",
    "sortablejs": "^1.10.2",
    "tslib": "^2.1.0",
    "workbox-build": "^3.6.3",
    "workbox-sw": "^3.6.3",
    "zone.js": "~0.10.2"
  },
  "optionalDependencies": {
    "fsevents": "^1.1.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1102.3",
    "@angular/cli": "^11.2.3",
    "@angular/compiler-cli": "11.2.4",
    "@angular/language-service": "11.2.4",
    "@commitlint/config-conventional": "^12.1.1",
    "@ngrx/schematics": "^11.0.1",
    "@nrwl/schematics": "^7.3.0",
    "@schematics/angular": "^8.3.24",
    "@types/faker": "^4.1.9",
    "@types/jasmine": "^3.6.5",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^12.11.1",
    "@types/sortablejs": "^1.10.4",
    "@types/stripe": "^6.32.13",
    "@types/stripe-v3": "^3.1.14",
    "codelyzer": "^6.0.0",
    "commitlint": "^12.1.1",
    "faker": "^4.1.0",
    "husky": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.1.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "^4.0.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "lint-staged": "^10.5.4",
    "prettier": "^2.2.1",
    "protractor": "~7.0.0",
    "ts-node": "^7.0.1",
    "tslint": "~6.1.0",
    "typescript": "4.0.7"
  },
  "lint-staged": {
    "**/*.ts": [
      "tslint -p ./tsconfig.json --fix"
    ]
johnhunter commented 3 years ago

It might be a problem with @types/pdfobject. Try downgrading that to 2.0.6

SheppardX commented 3 years ago

thx i will try that, i found a workaroung with Renderer2 from angular but that alot of code instead of the PDFObject oneliner

johnhunter commented 3 years ago

Cool. I've had other problems with @types/pdfobject@2.2.0 but haven't got the bandwidth to raise a PR, specifically fallbackLink should be string | boolean | undefined not boolean | undefined

pipwerks commented 3 years ago

Hi @SheppardX

Sorry to see you're having an issue. The types package is not something I've worked with. You'd need to reach out to them for guidance or assistance.

@johnhunter thanks for the pointer

SheppardX commented 3 years ago

Cool. I've had other problems with @types/pdfobject@2.2.0 but haven't got the bandwidth to raise a PR, specifically fallbackLink should be string | boolean | undefined not boolean | undefined

it worked thx you !!

SuneRadich commented 3 years ago

I see this error as well, but I am not using pdfobject. Any other pointers to what might cause it?

SheppardX commented 3 years ago

for me it fixed downgrading to 2.0.6

Am Mo., 31. Mai 2021 um 11:09 Uhr schrieb Sune Radich Vestergaard < @.***>:

I see this error as well, but I am not using pdfobject. Any other pointers to what might cause it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pipwerks/PDFObject/issues/245#issuecomment-851345164, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRRW7QZUXDZRW3F23LIV3TQNG5ZANCNFSM44X6NI3Q .

johnhunter commented 3 years ago

I see this error as well, but I am not using pdfobject. Any other pointers to what might cause it?

@SuneRadich just to be clear, this is a problem with @types/pdfobject, not pdfobject. If you don't use pdfobject then uninstall @types/pdfobject

pipwerks commented 3 years ago

Since this is not a bug with PDFObject I'm going to close the issue. Thanks

johnhunter commented 3 years ago

Just an update to say @types/pdfobject@2.2.2 works fine with pdfobject.