Javascript 未捕获类型错误:无法读取属性';原型&x27;未定义bitcoinjs库的定义 总结
角度应用程序使用Javascript 未捕获类型错误:无法读取属性';原型&x27;未定义bitcoinjs库的定义 总结,javascript,angular,typescript,Javascript,Angular,Typescript,角度应用程序使用ng serve-o成功构建 但我在chrome控制台中遇到错误 我甚至不需要调用这个方法,它在调用任何东西之前就会中断 它在makeTransaction()函数中中断 错误 我已尝试删除节点模块文件夹并运行>npm install, 我已尝试在app.module.ts文件中导入包装,但出现另一个错误 data.service.ts Uncaught TypeError: Cannot read property 'prototype' of undefined at
ng serve-o成功构建
但我在chrome控制台中遇到错误
我甚至不需要调用这个方法,它在调用任何东西之前就会中断
它在makeTransaction()函数中中断
错误
我已尝试删除节点模块文件夹并运行>npm install,
我已尝试在app.module.ts文件中导入包装,但出现另一个错误
data.service.ts
Uncaught TypeError: Cannot read property 'prototype' of undefined
at inherits (inherits_browser.js:5)
at Object.../../../../../../node_modules/hash-base/index.js (index.js:23)
at __webpack_require__ (bootstrap:78)
at Object.../../../../../../node_modules/md5.js/index.js (index.js:3)
at __webpack_require__ (bootstrap:78)
at Object.../../../../../../node_modules/create-hash/browser.js (browser.js:3)
at __webpack_require__ (bootstrap:78)
at Object.../../../../../../node_modules/bitcoinjs-lib/node_modules/bip32/src/crypto.js (crypto.js:3)
at __webpack_require__ (bootstrap:78)
at Object.../../../../../../node_modules/bitcoinjs-lib/node_modules/bip32/src/bip32.js (bip32.js:3)
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import * as bitcoin from 'bitcoinjs-lib';
@Injectable({
providedIn: 'root'
})
export class DataService {
constructor(private http: HttpClient, private network: any) {
network = bitcoin.networks.testnet;
}
// Make transaction
makeTransaction() {
// Network specification
const test = this.network;
}