XavierCHN / x-template

DOTA2自定义游戏开发模板项目,使用typesscript和react开发; Xavier's DOTA 2 custom game template using typescript and react-panorama
MIT License
154 stars 88 forks source link

TS2584: Cannot find name 'console'. Do you need to change your target library? #29

Closed X3CP4o2 closed 1 year ago

X3CP4o2 commented 1 year ago

After Valve updated the javascript engine I got multiple errors regarding eval ... Function(...).

Updated my package to match yours and removed the plugin from webpack.dev.

Now i recieve: ERROR in content/panorama/src/utils/x-nettable-dispatcher.ts:110:9 TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. 108 | } 109 | } catch (error) {

110 | console.log(x_net_table dispatch error: ${table_name} -> ${key} -> ${content}); | ^^^^^^^ 111 | } 112 | } 113 |

Seems like the original panorama polyfill is missing?

XavierCHN commented 1 year ago

please try to restart your editor and try again if you are sure you upgrade panorama-polyfill to "@demon673/panorama-polyfill" correctly

X3CP4o2 commented 1 year ago

please try to restart your editor and try again if you are sure you upgrade panorama-polyfill to "@demon673/panorama-polyfill" correctly

I fixed it by importing: import '@demon673/panorama-polyfill/lib/console';

instead of just panorama-polyfill/lib/console

thanks for answering :)