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

Sass resolution issue with webpack 5 (via shakapacker) #102

Closed
tagliala opened this issue Feb 27, 2022 · 1 comment
Closed

Sass resolution issue with webpack 5 (via shakapacker) #102

tagliala opened this issue Feb 27, 2022 · 1 comment

Comments

@tagliala
Copy link

Hi,

I'm experiencing an issue with a shakapacker build system based on webpack 5 when trying to import the scss file

@import "vanillajs-datepicker/sass/datepicker-bs5";

Error:

-- inner error --
Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  ╷
1 │ @import "vanillajs-datepicker/sass/datepicker-bs5";

This is caused by sass folder not being exported in exports package.json directive.

"exports": {
".": "./js/main.js",
"./Datepicker": "./js/Datepicker.js",
"./DateRangePicker": "./js/DateRangePicker.js",
"./locales/*": "./js/i18n/locales/*.js",
"./locales/": "./js/i18n/locales/"
},

Since I wasn't able to override a package.json dependency directive in my application, I've forked this repo and made a new branch here: https://github.com/tagliala/vanillajs-datepicker/tree/bugfix/export-sass

With my branch:

webpack 5.69.1 compiled successfully in 7385 ms

Versions and tools:

$ yarn --version
1.22.17

$ bin/webpacker --version
webpack: 5.69.1
webpack-cli: 4.9.2
webpack-dev-server 4.7.4

Providing a minimum reduced test case is possible, but it will require some time. Please let me know if it is needed

PS: I'm not a javasacript developer, so I do not know if there are side effects in adding sass folder to the exports

tagliala added a commit to tagliala/vanillajs-datepicker that referenced this issue Feb 27, 2022
@tagliala
Copy link
Author

Just realized this is a duplicate of #87, sorry

tagliala added a commit to tagliala/vanillajs-datepicker that referenced this issue Feb 27, 2022
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