我有下面的代碼讀取一個CSV文件,然後拉從數據庫中的文檔:查詢db時出現「無法等光纖」錯誤?
fs.readFile process.env.PWD + '/data/errorports.csv', 'utf8', (err, data) ->
if err
console.log "Error reading csv", err
return
rows = data.split('\n')
for row in rows
columns = row.split(',')
airportCode = columns[0]
airport = Airports.findOne({_id: airportCode})
console.log 'airport:', airport
但是當我打電話Airports.findOne({_id: airportCode})
它拋出的錯誤:
/Users/abemiessler/.meteor/packages/meteor-tool/.1.3.4.19lp8gr++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:159
throw new Error('Can\'t wait without a fiber');
^
Error: Can't wait without a fiber
誰能明白我爲什麼會得到這個錯誤?有關如何避開它的任何建議?