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 default.theme.css with yarn pnp #656

Open
v-pi opened this issue Dec 19, 2024 · 0 comments
Open

Cannot import default.theme.css with yarn pnp #656

v-pi opened this issue Dec 19, 2024 · 0 comments

Comments

@v-pi
Copy link

v-pi commented Dec 19, 2024

Hello,

When building our styles.scss with angular2-multiselect-dropdown, if we use yarn with pnp, we get the following error message :

./src/styles.scss - Error: Module build failed (from ./.yarn/__virtual__/css-loader-virtual-1620859bb0/7/AppData/Local/Yarn/Berry/cache/css-loader-npm-6.10.0-d6e93931e9-10.zip/node_modules/css-loader/dist/cjs.js):
Error: Package path ./themes/default.theme.css is not exported from package \AppData\Local\Yarn\Berry\cache\angular2-multiselect-dropdown-npm-10.0.0-5e5cdd195c-10.zip\node_modules\angular2-multiselect-dropdown\ (see exports field in \AppData\Local\Yarn\Berry\cache\angular2-multiselect-dropdown-npm-10.0.0-5e5cdd195c-10.zip\node_modules\angular2-multiselect-dropdown\package.json)

Would it be possible to add the css files to the list of exports in the package.json file ?

Before :

  "exports": {
    "./package.json": {
      "default": "./package.json"
    },
    ".": {
      "types": "./index.d.ts",
      "esm2022": "./esm2022/angular2-multiselect-dropdown.mjs",
      "esm": "./esm2022/angular2-multiselect-dropdown.mjs",
      "default": "./fesm2022/angular2-multiselect-dropdown.mjs"
    }
  }

Sample after :

  "exports": {
    "./themes/default.theme.css": {
      "default": "./themes/default.theme.css"
    },
    "./package.json": {
      "default": "./package.json"
    },
    ".": {
      "types": "./index.d.ts",
      "esm2022": "./esm2022/angular2-multiselect-dropdown.mjs",
      "esm": "./esm2022/angular2-multiselect-dropdown.mjs",
      "default": "./fesm2022/angular2-multiselect-dropdown.mjs"
    }
  }

Thanks and regards,
Valentin

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