monkey-master icon indicating copy to clipboard operation
monkey-master copied to clipboard

关于deno run后出现的报错

Open a1w5afe opened this issue 3 years ago • 12 comments

(base) myfile@wendeMacBook-Pro monkey-master % deno run --allow-read --allow-write --allow-net --allow-run index.js Download https://esm.x-static.io/v12/[email protected]/esnext/lib/esm/puppeteer/web.js.js error: Import 'https://esm.x-static.io/v12/[email protected]/esnext/lib/esm/puppeteer/web.js.js' failed: 403 Forbidden Imported from "https://esm.sh/puppeteer-core/lib/esm/puppeteer/web.js:2"

a1w5afe avatar Dec 28 '20 13:12 a1w5afe

看起来是这个源挂了

可以替换为 https://unpkg.com/[email protected]/lib/esm/puppeteer/web.js

qiin2333 avatar Dec 28 '20 13:12 qiin2333

那个,我没找到在哪替换,我看到download那行后缀有两个.js我就感觉不对劲儿,想找代码来着- -没找到 OqO阿巴阿巴

a1w5afe avatar Dec 28 '20 13:12 a1w5afe

啊!找到了!在browser.js里面!谢谢大佬!

a1w5afe avatar Dec 28 '20 13:12 a1w5afe

替换browser.js中的源之后,出现 Check file:///Users/myfile/gitclone/monkey-master/index.js error: TS2578 [ERROR]: Unused '@ts-expect-error' directive. // @ts-expect-error Chrome still supports behavior: instant but ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ at https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js:266:21

TS2578 [ERROR]: Unused '@ts-expect-error' directive. // @ts-expect-error Chrome still supports behavior: instant but ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ at https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js:284:21

Found 2 errors. 是不是换源之后还需要进行一些其他的更改呀?

a1w5afe avatar Dec 28 '20 13:12 a1w5afe

sorry 这个版本有坑 需要 run with no-check

qiin2333 avatar Dec 28 '20 14:12 qiin2333

好的,我试试,谢谢

a1w5afe avatar Dec 28 '20 14:12 a1w5afe

发现新的源还是有问题,新的源报错信息中这个js文件https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js 有两处使用了// @ts-expect-error注释 经过查阅:

// @ts-expect-error注释。如果我们在代码行之前将此注释作为前缀放置,TypeScript将不会报告错误。但是,如果没有错误,TypeScript将告知我们的代码中有不必要的注释,如下所示:Unused '@ts-expect-error' directive。 然后导致运行报错OpO

a1w5afe avatar Dec 28 '20 17:12 a1w5afe

发现新的源还是有问题,新的源报错信息中这个js文件https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js 有两处使用了// @ts-expect-error注释 经过查阅:

// @ts-expect-error注释。如果我们在代码行之前将此注释作为前缀放置,TypeScript将不会报告错误。但是,如果没有错误,TypeScript将告知我们的代码中有不必要的注释,如下所示:Unused '@ts-expect-error' directive。 然后导致运行报错OpO

大佬遇到这种情况过吗?

a1w5afe avatar Dec 29 '20 06:12 a1w5afe

发现时deno版本的问题,brew install deno,我朋友装的1.6.0版本完全没问题,我也brew install deno,他就给我装了1.4.9有毒

a1w5afe avatar Dec 29 '20 11:12 a1w5afe

https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js 有两处使用了// @ts-expect-error注释
导致报错 如何解决?

hexiaoan1984 avatar Jan 24 '21 11:01 hexiaoan1984

https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js 有两处使用了// @ts-expect-error注释 导致报错 如何解决?

当场自闭,一直没继续弄

a1w5afe avatar Jan 24 '21 11:01 a1w5afe

https://unpkg.com/[email protected]/lib/esm/puppeteer/common/JSHandle.js 有两处使用了// @ts-expect-error注释 导致报错 如何解决?

更新deno版本,见上条关于版本的描述,我能正常运行了,但是又有其他报错,我就不弄了,而且显卡现在都需要和茅台一样提前预约那种抢购方式了,不买了,不当猴子了

a1w5afe avatar Jan 24 '21 11:01 a1w5afe