klren0312 / daliy_knowledge

知识积累,正确使用方式是watch
21 stars 4 forks source link

vue使用ffmpeg报错Module parse failed: Unexpected token (29:51) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | /* From remote server/URL */ | } else { > const res = await fetch(new URL(_data, import.meta.url).href); | data = await res.arrayBuffer(); | } #719

Open klren0312 opened 1 year ago

klren0312 commented 1 year ago

image

参考资料

https://stackoverflow.com/questions/73685095/im-getting-error-while-building-the-project-in-vue-for-ffmpeg-wasm

报错信息

 in ./node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js

Module parse failed: Unexpected token (29:51)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     /* From remote server/URL */
|     } else {
>       const res = await fetch(new URL(_data, import.meta.url).href);
|       data = await res.arrayBuffer();
|     }

 error  in ./node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js

Module parse failed: Unexpected token (33:52)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|       throw Error('corePath should be a string!');
|     }
>     const coreRemotePath = new URL(_corePath, import.meta.url).href;
|     const corePath = await toBlobURL(
|       coreRemotePath,

 error  in ./node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js

Module parse failed: Unexpected token (7:68)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|  */
| const corePath = typeof process !== 'undefined' && process.env.NODE_ENV === 'development'
>   ? new URL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js', import.meta.url).href
|   : `https://unpkg.com/@ffmpeg/core@${pkg.devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`;
|