Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I use npm install,ReferenceError: require is not defined #1

Open
Gordon-007 opened this issue Nov 23, 2023 · 4 comments
Open

I use npm install,ReferenceError: require is not defined #1

Gordon-007 opened this issue Nov 23, 2023 · 4 comments

Comments

@Gordon-007
Copy link

node 18 + npm 8.15.0
npm install
npm run dev

it run with error:
ReferenceError: require is not defined
at cleanRequireCache (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite-plugin-mock/dist/index.mjs:128:3)
at getMockConfig (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite-plugin-mock/dist/index.mjs:157:3)
at createMockServer (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite-plugin-mock/dist/index.mjs:52:20)
at configResolved (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite-plugin-mock/dist/index.mjs:246:16)
at file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite/dist/node/chunks/dep-ErEj4WmL.js:66034:24
at Array.map ()
at resolveConfig (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite/dist/node/chunks/dep-ErEj4WmL.js:66034:10)
at async _createServer (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite/dist/node/chunks/dep-ErEj4WmL.js:58335:20)
at async CAC. (file:///D:/webstormSpace/com.react/react-admin-design/node_modules/vite/dist/node/cli.js:764:24)

@Gordon-007
Copy link
Author

when vite-plugin-mock version down to 2.9.8,it run well

@baimingxuan
Copy link
Owner

yes,you are right, thank you

@baimingxuan
Copy link
Owner

It's been fixed

@condorheroblog
Copy link

@baimingxuan Are you interested in using vite-plugin-fake-server to replace vite-plugin-mock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants