Comments (7)
@anthony-kopczyk, thanks for letting us know. Could you share the exact error you're getting? Is Sass having trouble understanding that it's a multiplication expression without the space? And could you tell us what version of Sass you're using?
from design-system.
@pwolfert When we import into our javascript we get the same error, so I don't think it's the sass compiling itself. Our sass is set to ^1.53.0, which looks like it's the same as the DS.
import '@cmsgov/ds-medicare-gov/dist/css/index.css';
The exact error looks like postcss is unable to load the css file.
ERROR in ./node_modules/@cmsgov/ds-medicare-gov/dist/css/index.css (./node_modules/react-scripts/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-4-1!./node_modules/react-scripts/node_modules/postcss-loader/src??postcss!./node_modules/@cmsgov/ds-medicare-gov/dist/css/index.css)
Module build failed (from ./node_modules/react-scripts/node_modules/postcss-loader/src/index.js):
ParserError: Syntax Error at line: 1, column 31
at .../node_modules/@cmsgov/ds-medicare-gov/dist/css/index.css:1:39006
at Parser.error (.../node_modules/postcss-values-parser/lib/parser.js:127:11)
at Parser.operator (.../node_modules/postcss-values-parser/lib/parser.js:162:20)
at Parser.parseTokens (.../node_modules/postcss-values-parser/lib/parser.js:245:14)
at Parser.loop (.../node_modules/postcss-values-parser/lib/parser.js:132:12)
at Parser.parse (.../node_modules/postcss-values-parser/lib/parser.js:51:17)
at parse (.../node_modules/postcss-custom-properties/index.cjs.js:47:30)
at .../node_modules/postcss-custom-properties/index.cjs.js:333:24
at .../node_modules/postcss/lib/container.js:194:18
at .../node_modules/postcss/lib/container.js:139:18
at Rule.each (.../node_modules/postcss/lib/container.js:105:16)
Our version of postcss is 7.0.39, while it looks like the design system is using 8. I don't see any breaking changes listed in the postcss changelog.
from design-system.
@anthony-kopczyk, I have modified one of our examples to...
- Import the
ds-medicare-gov
styles within a Sass file as Sass and not as CSS - Backtrack to a version of
react-scripts
that uses WebPack 4 and Postcss7.0.39
Unfortunately this didn't reproduce the error, though. While we still don't know why this is happening, it doesn't change the fact that it is. If you were to reverse the order of the operands, would it give the same error? I think the following regex should work to flip them all in that minifed CSS file:
- Search:
calc\((var\([a-z\-]*\))\*-(.*?)\)
- Replace:
calc(-$2*$1)
That replace pattern is what the search and replace tool in vscode expects. I'm not sure how universal that is.
from design-system.
Do you have a postcss configuration you could share? It looks like versions 7.x.x of postcss required a config? I'm curious what parsers you're using with postcss and what versions they're set to.
from design-system.
I found this issue which seems similar, which is what makes me wonder if one of the postcss
dependencies needs upgrading as well.
from design-system.
We're using react-scripts, and it manages the config for us by default. We're behind a major version on react-scripts. Updating react-scripts should update our config to at least v3 of the postcss parser (might go to 4 it looks like). I think if we upgrade react-scripts on our app, it may resolve this, and we've been wanting to update react-scripts for a while now.
I think we can close this issue, but if there's a simple patch or other teams run into this, it's maybe something to consider.
from design-system.
Closing!
from design-system.
Related Issues (20)
- [Accessibility] Add documentation for adding "Error" to page title HOT 3
- Add a print icon HOT 1
- Tooltips open on touchmove
- Migration Script Error HOT 5
- Request for documentation for a pattern and guidance for links/buttons that are document downloads, i.e. PDF HOT 1
- Inline form errors should indicate they're errors to screen readers HOT 4
- `inputRef` prop being passed into DOM when using <Dropdown /> HOT 6
- [Accessibility] h4 in footer component causes heading order issues HOT 1
- Calendar Picker Component allows for unlimited entry of numbers
- [Accessibility] healthcare.gov logo's svg elements are being read out by VoiceOver HOT 1
- Allow Alerts to take custom icons
- [Accessibility] Footer social icons do not provide an accessible name HOT 3
- Versions of @types/react greater than 18.2.21 cause TypeScript errors
- Spinner does not cover Dialog HOT 6
- Wrong code on NPM for 7.0.7 release HOT 1
- Badge: Add variation that allows the badge to display block HOT 4
- Add more font weights for custom fonts HOT 1
- ChoiceList "hint" states Hints are their own component HOT 3
- Choice List hint wrapping text prematurely
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from design-system.