Closed armandolezama closed 1 year ago
Good night! I just release a new version that remove all specific generators from the package so you shouldnt have this kind of error again. That is a breaking change and also schemas and generation must be updated, just in case =)
Hi, when I install and import mocker, the next error is thrown:
Uncaught TypeError: moment.locale is not a function at node_modules/casual-browserify/src/providers/ar_SY/date.js (date.js:2:8) at __require2 (chunk-S5KM4IGW.js?v=05871a14:18:50) at node_modules/casual-browserify/src/casual_browserify.js (casual_browserify.js:21:16) at __require2 (chunk-S5KM4IGW.js?v=05871a14:18:50) at Generator.ts:6:11
This error appears in my browser after I serve my aplication. This happens when mocker is imported with the next line:
import mocker from 'mocker-data-generator';
I'm using vite and react, and these are my dependencies (package.json example):
{ "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@fontsource/public-sans": "^4.5.11", "@fontsource/roboto": "^4.5.8", "@mui/icons-material": "^5.10.14", "@mui/joy": "^5.0.0-alpha.56", "@mui/material": "^5.10.14", "@mui/x-data-grid": "^5.17.13", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.4.3" }, "devDependencies": { "@types/react": "^18.0.24", "@types/react-dom": "^18.0.8", "@vitejs/plugin-react": "^2.2.0", "mocker-data-generator": "^2.12.0", "vite": "^3.2.3", "vite-plugin-pwa": "^0.13.3" } }
I tried to install moment and casual-browserify but the result is the same