yracnet / vite-plugin-json-server

MIT License
5 stars 1 forks source link

TypeError: jsonServer is not a function #2

Open tuanyh11 opened 4 weeks ago

tuanyh11 commented 4 weeks ago

TypeError: jsonServer is not a function at file:///Users/leo/Learn/elysiajs/dash/vite.config.ts.timestamp-1730602972660-4e0d727285a7.mjs:5:1 at ModuleJob.run (node:internal/modules/esm/module_job:268:25) at async onImport.tracePromise.proto (node:internal/modules/esm/loader:543:26) at async loadConfigFromBundledFile (file:///Users/leo/Learn/elysiajs/dash/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66691:15) at async loadConfigFromFile (file:///Users/leo/Learn/elysiajs/dash/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66532:24) at async resolveConfig (file:///Users/leo/Learn/elysiajs/dash/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66140:24) at async _createServer (file:///Users/leo/Learn/elysiajs/dash/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:62758:18) at async CAC. (file:///Users/leo/Learn/elysiajs/dash/node_modules/vite/dist/node/cli.js:735:20)

yracnet commented 3 weeks ago

hi, it is a old issue in tsup, please change the import line to:

import { pluginJsonServer } from "vite-pligin-json-server"