Closed johnhunter closed 8 months ago
Node: v20.11.0 Vite: 5.1.1 vite-plugin-mock-server: 1.1.2 Package:
{ "type": "module", }
Added the plugin to a vite project with the default mock module location. Starting the dev server resulted in a require is not defined error:
require is not defined
[vite-plugin-mock-server] [ 'watched root dir is', '[...]/mock' ] [vite-plugin-mock-server] [ 'recursive loading mock modules', '[...]/mock' ] [vite-plugin-mock-server] [ 'loading mock module', '[...]/mock/endpoints.mock.js' ] [vite-plugin-mock-server] [ 'delete module cache', '[...]/mock/endpoints.mock.js' ] file:///[...]/node_modules/vite-plugin-mock-server/dist/index.js:193 delete require.cache[moduleName]; ^ ReferenceError: require is not defined
It might be related to, or resolved by https://github.com/enjoycoding/vite-plugin-mock-server/pull/29 ?
Am unable to verify the example from the plugin repo as npm install gives the following error:
npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz failed, reason: certificate has expired
Thanks @tGrefsrud Hopefully it will be merged and released soon! 🤞
PR https://github.com/enjoycoding/vite-plugin-mock-server/pull/29 has been merged, thank you for @reinerBa contribution.
Node: v20.11.0 Vite: 5.1.1 vite-plugin-mock-server: 1.1.2 Package:
Added the plugin to a vite project with the default mock module location. Starting the dev server resulted in a
require is not defined
error:It might be related to, or resolved by https://github.com/enjoycoding/vite-plugin-mock-server/pull/29 ?
Am unable to verify the example from the plugin repo as npm install gives the following error: