fusepilot / create-cep-extension

A near zero config approach to creating CEP extensions with Webpack and React.
Other
87 stars 15 forks source link

Importing Mantine styling library causes compilation failure #89

Open yahiaboudah opened 2 years ago

yahiaboudah commented 2 years ago

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

How to reproduce the error with npm:

in terminal:

Description

Running this in the browser 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.