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";


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM