build fail when including cfb 1.0.3
jdeviney opened this issue · 1 comments
I'm trying to import and use xlsx which depends on cfb. When I build my angular 5 project I get the following error:
ERROR in node_modules/cfb/types/index.d.ts(38,24): error TS2304: Cannot find name 'Buffer'. src/app/components/purchase-order/register/register.component.ts(98,12): error TS2304: Cannot find name 'Buffer'.
I have no problem resolving this base type in my main project but it fails inside of cfb. Am I using an incompatible module or is this possibly a bug in cfb? My package.json file contents:
{
"name": "venus-app-client",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy-config.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"angular/animations": "^5.2.3",
"angular/cdk": "^5.1.1",
"angular/common": "^5.2.3",
"angular/compiler": "^5.2.3",
"angular/core": "^5.2.3",
"angular/forms": "^5.2.3",
"angular/http": "^5.2.3",
"angular/platform-browser": "^5.2.3",
"angular/platform-browser-dynamic": "^5.2.3",
"angular/router": "^5.2.3",
"ngx-translate/core": "^9.1.1",
"types/lodash": "^4.14.100",
"cfb": "^1.0.3",
"codelyzer": "^4.1.0",
"commander": "^2.14.1",
"core-js": "^2.5.3",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"lodash": "^4.17.4",
"primeng": "^5.2.0",
"printj": "^1.1.1",
"rxjs": "^5.5.6",
"typescript": "~2.4.2",
"xlsx": "^0.12.1",
"zone.js": "^0.8.20"
},
"devDependencies": {
"angular/cli": "^1.6.7",
"angular/compiler-cli": "^5.2.3",
"angular/language-service": "^5.2.3",
"types/jasmine": "^2.8.6",
"types/jasminewd2": "^2.0.2",
"types/node": "^6.0.96",
"jasmine-core": "^2.9.1",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.1",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.3.0",
"ts-node": "^3.3.0",
"tslint": "^5.9.1"
}
}
We just pushed 1.0.4 with a fixed type definition -- you should be able to npm rm xlsx
and npm i xlsx
again to pick up the latest version of the dependency.