ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
14.01k stars 816 forks source link

SyntaxError: Unexpected token 'export' #519

Closed awvalenti closed 1 year ago

awvalenti commented 1 year ago

Describe the bug Can't import '@ffmpeg/ffmpeg'. Produces error: SyntaxError: Unexpected token 'export'. Using Node.js v18.17.0.

To Reproduce Steps to reproduce the behavior:

npm init -y
npm i '@ffmpeg/ffmpeg'
echo "import '@ffmpeg/ffmpeg'" > index.mjs
node index.mjs

Expected behavior Should import appropriately

Desktop (please complete the following information):

jeromewu commented 1 year ago

nodejs is not supported starting from 0.12.0, please faq here: https://ffmpegwasm.netlify.app/docs/faq#why-ffmpegwasm-doesnt-support-nodejs

awvalenti commented 1 year ago

Thanks for the response. fluent-ffmpeg didn't fit for me either. I'm moving to https://github.com/eshaz/wasm-audio-decoders/tree/master/src/mpg123-decoder or https://github.com/eshaz/wasm-audio-decoders/tree/master/src/flac.

Em qui., 27 de jul. de 2023 12:42, Aleksandr Vasilenko < @.***> escreveu:

nodejs is not supported starting from 0.12.0, please faq here: https://ffmpegwasm.netlify.app/docs/faq#why-ffmpegwasm-doesnt-support-nodejs

How exactly fluent-ffmpeg is a better alternative? It's unmaintained, hasn't been updated in 6 years, has tons of bugs, ancient ffmpeg version, etc.

— Reply to this email directly, view it on GitHub https://github.com/ffmpegwasm/ffmpeg.wasm/issues/519#issuecomment-1653876021, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGL22PNU5QMCVALNLYH6E3XSKD6TANCNFSM6AAAAAA2ZHB2VU . You are receiving this because you authored the thread.Message ID: @.***>

wesbos commented 1 year ago

Shoot, just moved back to this package as I saw it was updated, but hit with this error as well. Didn't read the release notes to see that Node.js was dropped.

Will try to move back to this package:

https://www.npmjs.com/package/@ffmpeg.wasm/main