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

React App Build Failed (Cannot read properties of undefined (reading 'constantViolations')) #3229

Closed
seeratawan01 opened this issue Dec 22, 2022 · 2 comments

Comments

@seeratawan01
Copy link
Contributor

What package has an issue

@mantine/core

Describe the bug

image

React app is working fine in dev mode, but with build command I'm getting this error. I created the simple react app with CRA and added mantine and typescript after that. Wrapped the component in MantineProvider and try to build the app with npm run build and this error is failing the build process.

@floating-ui is being used by Mantine internally so I think it's due to mantine.

app.tsx
image

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": "src",
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": ["src"]
}

What version of @mantine/hooks page do you have in package.json?

5.9.5

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

@seeratawan01
Copy link
Contributor Author

seeratawan01 commented Dec 22, 2022

babel/babel#15300 this issue is from babel side and not fixed yet.

@rtivital
Copy link
Member

The issue is with your build system, applications with @mantine packages build correctly with other bundlers. I advise using vite instead of CRA.

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

2 participants