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

Compiler error when trying to import styles #384

Open
llRandom opened this issue May 14, 2024 · 3 comments
Open

Compiler error when trying to import styles #384

llRandom opened this issue May 14, 2024 · 3 comments

Comments

@llRandom
Copy link

llRandom commented May 14, 2024

I'm using this package in angular project with scss styles. I'm trying to reference the style using this line

@import 'quill-mention/dist/quill.mention.css';

The compiler gives this error

./src/styles.scss - Error: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
Error: Package path ./dist/quill.mention.css is not exported from package my-local-path\node_modules\quill-mention (see exports field in my-local-path\node_modules\quill-mention\package.json)

The error appears in version 6.0.0. There's no such error in version 5.0.1

@vvkotov
Copy link

vvkotov commented May 20, 2024

+1

@rpw1
Copy link

rpw1 commented Aug 2, 2024

Here is a temporary workaround until this is fixed:

In my project, we reference the css file by using

@import '~quill-mention/dist/quill.mention.css';

I was getting the same error as shown above. I changed the import to:

@import '/node_modules/quill-mention/dist/quill.mention.css';

Now it works perfectly!

@KeithGillette
Copy link

Without the leading /, the work-around provided by @rpw1 also works in our Nx monorepository, which bundles the quill-mention styles for lazy-loading in a project.json targets.build.option.styles array:

  {
    "input": "node_modules/quill-mention/dist/quill.mention.css",
    "bundleName": "quill-mention",
    "inject": false
  },

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

4 participants