tesseract.js-angular-app
tesseract.js-angular-app copied to clipboard
Angular 9.1 build error Cannot find name 'Buffer'
I'm running angular 9.1 with Ivy switched on and I get the following error when building
ERROR in node_modules/tesseract.js/src/index.d.ts:104:60 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i @types/nodeand then add
node to the types field in your tsconfig.
Node types are installed and is in tsconfig.
ng v10 added to tsconfig.app.json
"types": [
"node"
]
and work fine :) tsconfig.app.json now:
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [
"node"
]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
]
}