vscode自动添加了这么一句
import { Template } from "webpack";
导致出现奇葩错误
Can't resolve 'fs' in '/xxx/Desktop/ncpub/node_modules/.pnpm/[email protected]/node_modules/move-concurrently Can't resolve 'fs' in '/xxx/Desktop/ncpub/node_modules/.pnpm/[email protected]/node_modules/path-exists' Can't resolve 'fs' in '/xxx/Desktop/ncpub/node_modules/.pnpm/[email protected]/node_modules/y18n' Can't resolve 'module' in '/xxx/Desktop/ncpub/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/lib' ERROR in ./node_modules/.pnpm/[email protected]/node_modules/fsevents/fsevents.node 1:0 Module parse failed: Unexpected character '�' (1:0) 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
错误很诡异,看起来像是缺少包,或node版本问题,删了重装,node也重装,于事无补
好在错误暴漏了原始错误文件
./src/xxx/public/xxx.js
只是代码不是自己加的,也没有git管理,所以不知道错误在此
在此文件逐句排查,可发现错误
标签:node,vscode,xxx,modules,Desktop,webpack,报错,pnpm,import From: https://www.cnblogs.com/mengff/p/17672551.html