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

Cannot import css from mantine-datatable #9540

Closed
eekboom opened this issue Feb 23, 2024 · 3 comments
Closed

Cannot import css from mantine-datatable #9540

eekboom opened this issue Feb 23, 2024 · 3 comments

Comments

@eekboom
Copy link

eekboom commented Feb 23, 2024

🐛 bug report

Cannot import CSS from matine-datatable npm package.

The documentation tells me to use
import 'mantine-datatable/styles.css';
see https://icflorescu.github.io/mantine-datatable/getting-started/

But when I do that, I get
@parcel/core: Failed to resolve 'mantine-datatable/styles.css' from './src/index.tsx'

The matine-datatable package.json contains this

  "exports": {
    "./styles.css": "./dist/styles.css",
    "./styles.layer.css": "./dist/styles.layer.css"
  },

At first I thought that it was #4155, but that seems to be already fixed in parcel 2.11.0.

As a workaround this seems to work if I use

import 'mantine-datatable/dist/styles.css';

🌍 Your Environment

Software Version(s)
Parcel 2.11.0
Node 20.11.1
npm/Yarn yarn 4.1.0 pnp
Operating System Windows 10
@devongovett
Copy link
Member

See https://parceljs.org/features/dependency-resolution/#enabling-package-exports for how to enable package.json exports support.

@eekboom
Copy link
Author

eekboom commented Feb 23, 2024

Thanks a lot! Works fine. I think it could be easier to discover, though.

Would it be too much to ask that in case resolve fails to check for presence of "exports" in the relevant package,json and then give a hint in the error message that this feature might have to be turned on?

@devongovett
Copy link
Member

good idea

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