0
我一直在使用psd.js和我的懸浮窗reactjs項目配置這樣
PSD.js在反應錯誤fs.readFileSync不是一個函數
accept: function(file, done){
const reader = new FileReader();
reader.onload = handleReaderLoad;
reader.readAsDataURL(file);
function handleReaderLoad(evt) {
console.log(evt.target.result);
let psdFile = PSD.fromFile(evt.target.result);
psdFile.parse();
console.log(psdFile);
}
done();
},
的錯誤是:
Uncaught TypeError: fs.readFileSync is not a function
at Function.fromFile (init.coffee:6)
at FileReader.handleReaderLoad (index.js?03a7:153)
在我的webpack配置我inlclude:
node: {
fs: 'empty'
},
,因爲如果不包含它,錯誤not found fs module
請幫助
如果我使用'PSD.fromEvent()'的errror是'遺漏的類型錯誤:PSD.fromEvent不FileReader.handleReaderLoad'上的函數 。最新錯誤@pawel – Ariasa