TypeError: Object(…) is not a function || Typescript TS1259

问题:导入resampler时报错
官网:resampler = require('audio-resampler');
自己写的:import { resampler } from "audio-resampler";

解决:
因为这是一个比较老的npm包,不支持上面的那种导入方式。
修改成:
import * as resampler from "audio-resampler";

posted @ 2020-08-19 16:32  Shaw_喆宇  阅读(804)  评论(0编辑  收藏  举报