-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unable to compile BluePrint 4 SCSS with webpack sass-loader #6051
Comments
I tried to follow the webpack suggestion as well #5334 (comment) however this doesn't work and I would preferably not want to store a local copy of blueprint's icons. |
Sorry for the trouble here, could you share some of the issues you encountered with that approach? I'm open to making bugfixes which make it possible to continue compiling Blueprint's Sass code when it's consumed as an NPM package. I don't have a great alternative solution right now that doesn't involve advanced Blueprint consumers storing a copy of the icons SVG folder. We inline icons in a few places across the code base and there's a bit of work to untangle that which I don't have the bandwidth to do right now. So the inlining has to stay, at least for now. Note that the
|
Thanks @adidahiya I will try storing those icons locally and see if that works.
Once this was done, I ran npm start to run the dev server version of webpack where I then get the error above. If I run npm run build to create a production build, I also get the same error. |
@ahaganDEV so it sounds like you did not try using the new |
@adidahiya I didn't see that in the docs! I'll give that a go. I am currently using node 16 am I right that to use the node-build-scripts library I need to use node 18? |
@ahaganDEV Yes, this is enforced by the "engines" constraint defined for the @blueprintjs/node-build-scripts package. |
@adidahiya I am trying to import the node-build scripts into my webpack.config.js file like in the example. However, I get the error:
My project is using node 18.13.0, the I tried importing using require('@blueprintjs/node-build-scripts/import') as the package.json for @blueprintjs/node-build-scripts' has that in its exports section but that doesn't work either. Do you know how I can get this importing correctly in the project. Thanks. Here are some snippets of the webpack config: webpack.config.js
|
@adidahiya I got the above to start running by turning my webpack config into es6 format. However, I get an error when running webpack with the sassSvgInliner is this something that has been seen before or could something be configured wrong?
When I add console logs to sassSvgInliner function, I get this output for the args paramter: The sass in _breadcrumbs.scss is: and later on in the file |
Hello @ahaganDEV I am having the exact same problem that you described, have you found a solution to this yet?@adidahiya Do you have any idea how to resolve this? |
Hi @adidahiya, I am also facing same issue. |
Just wanted to add my +1 to the issue @ahaganDEV brought up above. I feel like I've got everything set up right, and yet, this custom function doesn't compile. My feeling is like, I don't know what the heck is going on, but I'm pretty sure the fault is with sass-loader. I made an issue there asking for help. |
There is an answer webpack-contrib/sass-loader#1137 (comment). Shortly - feel free to feedback |
@alexander-akait thanks for the clarification, I didn't realize that sass-loader only supports the legacy Sass render APIs.
There is an SVG inliner function available for the legacy Sass API. Blueprint was using a third-party library for this before we migrated to the newer API. It's called |
Thanks all! For anyone else who needs a workaround literally asap, I made a quick gist here: https://gist.github.com/eastside/adcdf0d189c7470be241a851c5add350 Instead of the normal factory, you'd use You'd just make a new file, maybe call it
|
@eastside
Additionally, it was required to install
That's all I had to adjust FYI @prachibansal01 |
Hi, wondering if there is any chance of an update on resolving this issue within the library?
Given it is a few functions, wondering if it would be possible to take another look? Thanks |
@pbower yes I'm interested in taking another look at the tooling issues here but a lot of things have changed since the original post so I think we should start a new thread and only concern ourselves with Blueprint v5.x, Node v18+, and dart-sass. Can you please file a new issue and describe your environment and the problems you're facing in more detail? |
Hi Adi,
Sure thing, I will do this later today and provide further details.
In summary - the underlying need mostly relates to overriding the Blueprint CSS _files with non-default values, to implement custom styles (particularly for the light blue colour, which is quite light against a white background), with more of a navy-like colour, as well as application-specific fonts.
This then results in the need to compile the SCSS files when building the application, which causes issues in the build process as describes.
Will comment with the issue number here once logged.
Thanks for your help with this!!
Regards,
Peter
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Adi Dahiya ***@***.***>
Sent: Friday, November 10, 2023 10:33:26 AM
To: palantir/blueprint ***@***.***>
Cc: Peter ***@***.***>; Mention ***@***.***>
Subject: Re: [palantir/blueprint] Unable to compile BluePrint 4 SCSS with webpack sass-loader (Issue #6051)
@pbower<https://github.com/pbower> yes I'm interested in taking another look at the tooling issues here but a lot of things have changed since the original post so I think we should start a new thread and only concern ourselves with Blueprint v5.x, Node v18+, and dart-sass. Can you please file a new issue and describe your environment and the problems you're facing in more detail?
—
Reply to this email directly, view it on GitHub<#6051 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI27BYRORI5MXPGAA35RI53YDVR4NAVCNFSM6AAAAAAWRG5LUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBUHA2DGMRXHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@pbower Did you ever create that new issue? I'm encountering the same thing and can't seem to find it if you have. |
Looks like sass-loader fixed the underlying issue (webpack-contrib/sass-loader#774) but SassSvgInlinerFactory still fails with exactly the same problem - anyone have any insight? |
No insights, except that it's makes it very difficult to use Blueprint 5, given that it breaks the project from compiling, including Storybook, without workarounds that rely on aging legacy plugins. Failed to compile. Which is a shame as it's such a great set of components. The below fix got me through the last 6 months by craco-ing around webpack, but now that dependencies for various project are forced to update, it and storybook has broken: /* eslint-disable */ const CracoEsbuildPlugin = require("craco-esbuild"); module.exports = { It relied on this plugin which now appears to be dead and incompatible- storybook-preset-craco@0.0.6 │ If there's any way you guys can fix this stuff will be much appreciated. |
I wonder if it couldn't be better to simply deprecate |
Environment
Steps to reproduce
npm install @blueprintjs/core@4.17.8
Actual behavior
Expected behavior
I would expect all of the blueprint internal SCSS files (e.g. the breadcrumb component scss file) to compile out of the box.
I have looked at all the similar issues raised but I am unable to follow them or to get this SCSS compiling. Are there any other steps that need to be done after installing this version of Blueprint? Previously working on Blueprint v3 had no compilation issues.
The text was updated successfully, but these errors were encountered: