likaia / js-screen-shot

web端自定义截图插件(原生JS版)
https://www.kaisir.cn/js-screen-shot/
MIT License
808 stars 107 forks source link

1.8.8 打包报错 和1.8.7同类型错误 #102

Closed LengJunT closed 1 year ago

LengJunT commented 1 year ago

ERROR Failed to compile with 1 errors3:39:43 PM

error in ./node_modules/.pnpm/js-web-screen-shot@1.8.8/node_modules/js-web-screen-shot/dist/screenShotPlugin.esm.js

Module parse failed: Cannot use keyword 'await' outside an async function (21:203918)

likaia commented 1 year ago

你用啥打包的?我用vite测试是好的呀

likaia commented 1 year ago

我试了下webpack也没报错呀

image
likaia commented 1 year ago

ERROR Failed to compile with 1 errors3:39:43 PM

error in ./node_modules/.pnpm/js-web-screen-shot@1.8.8/node_modules/js-web-screen-shot/dist/screenShotPlugin.esm.js

Module parse failed: Cannot use keyword 'await' outside an async function (21:203918)

更新到1.8.9-rc.0版本试一下

likaia commented 1 year ago

ERROR Failed to compile with 1 errors3:39:43 PM

error in ./node_modules/.pnpm/js-web-screen-shot@1.8.8/node_modules/js-web-screen-shot/dist/screenShotPlugin.esm.js

Module parse failed: Cannot use keyword 'await' outside an async function (21:203918)

定位到问题了,是因为打包后的代码没有转es5引发的。你更新到1.8.9-rc.1版本试试看。

likaia commented 1 year ago

该问题已修复,将插件更新至1.9.0版本即可。