farm icon indicating copy to clipboard operation
farm copied to clipboard

[Bug Report]: 使用 vite-plugin-node-polyfills 导致的编译器报错

Open dailong666 opened this issue 9 months ago • 1 comments

Steps to reproduce

import { nodePolyfills } from 'vite-plugin-node-polyfills'; vitePlugins: [ nodePolyfills(), ] 包地址:https://www.npmjs.com/package/vite-plugin-node-polyfills

"@farmfe/cli": "^1.0.0",
"@farmfe/core": "^1.0.14",

Reproduce link

No response

What is actually happening?

[ Farm ] Failed to start the server: Error: Failed to load farm config file: TypeError: (intermediate value)(intermediate value)(intermediate value).resolve is not a function TypeError: (intermediate value)(intermediate value)(intermediate value).resolve is not a function at resolvePath (file:///D:/Work/farm/vue-test/node_modules/.pnpm/[email protected]/node_modules/node-stdlib-browser/esm/index.js:34:133) at file:///D:/Work/farm/vue-test/node_modules/.pnpm/[email protected]/node_modules/node-stdlib-browser/esm/index.js:46:16 at ModuleJob.run (node:internal/modules/esm/module_job:194:25) at loadConfigFile (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/core/dist/config/index.js:605:15) at async resolveConfig (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/core/dist/config/index.js:63:30) at async start (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/core/dist/index.js:26:36) at async handleAsyncOperationErrors (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/cli/dist/utils.js:111:9)  ELIFECYCLE  Command failed with exit code 1.

System Info

[ Farm ] Failed to start the server: Error: Failed to load farm config file: TypeError: (intermediate value)(intermediate value)(intermediate value).resolve is not a function TypeError: (intermediate value)(intermediate value)(intermediate value).resolve is not a function
    at resolvePath (file:///D:/Work/farm/vue-test/node_modules/.pnpm/[email protected]/node_modules/node-stdlib-browser/esm/index.js:34:133)
    at file:///D:/Work/farm/vue-test/node_modules/.pnpm/[email protected]/node_modules/node-stdlib-browser/esm/index.js:46:16
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
    at loadConfigFile (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/core/dist/config/index.js:605:15)
    at async resolveConfig (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/core/dist/config/index.js:63:30)
    at async start (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/core/dist/index.js:26:36)
    at async handleAsyncOperationErrors (file:///D:/Work/farm/vue-test/node_modules/.pnpm/@[email protected]/node_modules/@farmfe/cli/dist/utils.js:111:9)
 ELIFECYCLE  Command failed with exit code 1.

dailong666 avatar May 14 '24 05:05 dailong666

@dailong666 你好,我尝试了一下 vite-plugin-node-polyfills,目前看起来没有异常。这个问题可能已经在新版本中被修复,可以试试用最新的 farm 来进行构建。

fu050409 avatar Jul 18 '24 11:07 fu050409