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

Importing Mantine styling library causes compilation failure #89

Open
yahiaboudah opened this issue May 24, 2022 · 0 comments
Open

Importing Mantine styling library causes compilation failure #89

yahiaboudah opened this issue May 24, 2022 · 0 comments

Comments

@yahiaboudah
Copy link

yahiaboudah commented May 24, 2022

OS: Windows:
BROWSER: CHROME: Version 101.0.4951.67 (Official Build) (64-bit)

How to reproduce the error with npm:

in terminal:

  • create-cep-extension myapp
  • npm install @mantine/core @mantine/hooks (react component library)
  • cd myapp/src
  • [vim|code|(text editor of choice)] App.js
  • add import { Button } from '@mantine/core'

Description

Running this in the browser with:

  • npm start
    produces a very long error that originates in the @radixui library starts with:

./node_modules/@radix-ui/react-scroll-area/dist/index.module.js
Module parse failed: C:\Users\usr\myapp\node_modules@radix-ui\react-scroll-area\dist\index.module.js
Unexpected token (1:810)
You may need an appropriate loader to handle this file type.

Expected behavior

Should work without any problems

Actual behavior

Fails at (1:810) which when closely inspected in the editor, we find an attempt to destructure an object:

const {
        __scopeScrollArea: t,
        type: n = "hover",
        scrollHideDelay: i = 600, // This is exactly where the location (1:810) where the error happens inside index.module.js
        ...a
    } = e, [d, p] = s.useState(null), [h, m] = s.useState(null), .... etc;

It's worth mentioning, that after some digging, I figured that the radixui library uses an old version of react (16.0 or 17.0) which seems incompatible with the default react version in the project, but even after changing the version in package.json in the main project directory, the problem persists.

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

1 participant