3

I have a working ionic 2 app. I wanted to add the openpgp library. So I did a npm install and then added the typings. Webpacks fine but now I get no errors, just a white screen. If I comment out the

import * as openpgp from 'openpgp'

the app will boot up fine. Since there are no errors generated during webpack nor at runtime in console I am at a loss at how to debug.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Eric G
  • 935
  • 12
  • 21

1 Answers1

0

Try using @types from DefinitelyTyped.

npm install --save openpgp

Install @types:

npm install --save-dev @types/openpgp.

Make sure you have the following set in compilerOptions in your tsconfig.json

"typeRoots": [
  "node_modules/@types"
]

import as below:

import * as openpgp from 'openpgp'
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103