You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using CRA with react scripts 4.0.3 and there is a nested dependency in the react scripts which causes it to use postcss 7 (Can't change it). In postcss 7, there is an issue (It was solved in postcss 8+) that when using calc function, if there are 3 or more variables used, it causes parsing issues.
When you try to build the project (npm run build), it causes parsing error:
Expecting end of input, "ADD", "SUB", "MUL", "DIV", got unexpected "RPAREN"
Now I just want to know how are we supposed to use themes with react scripts 4.0.3? I can't really update to newer version of react scripts.
The text was updated successfully, but these errors were encountered:
The thing prompting this now is that our deployments are broken because CRA is giving us obscure build errors for some of our newer dependencies, like @radix-ui/themes. This is apparently caused by outdated dependencies within CRA's toolchain. (radix-ui/themes#104, facebook/create-react-app#11767, and similar.) It's unclear if or when CRA is going to update those dependencies. From reactjs/react.dev#5487 (comment) and the lack of CRA releases since then, it seems like people generally aren't holding their breath.
I can't discern whether Vite is just JS framework hype, but for now at least, it seems easier to port to it than to keep limping along with CRA.
So, to do the port:
* Replace CRA's config files with the defaults from `npm create vite@latest`.
* Delete all the Progressive Web App stuff from CRA. We're not worrying about that for now.
* Update package.json...
* Add `"type": "module"` per https://vitejs.dev/guide/troubleshooting.html#cjs.
* Update scripts and dependencies per `npm create vite@latest`. Drop various testing-library dependencies added by CRA, since we weren't using them.
* Separate dependencies from devDependencies while we're here, just for human organization.
* Replace CRA's default readme with Vite's default readme.
* Port unit tests from Jest to Vitest. This just involves using explicit imports for the globals like `it` and `expect`.
I'm using CRA with react scripts 4.0.3 and there is a nested dependency in the react scripts which causes it to use postcss 7 (Can't change it). In postcss 7, there is an issue (It was solved in postcss 8+) that when using calc function, if there are 3 or more variables used, it causes parsing issues.
postcss/postcss-calc#77
The style.css of @radix-ui/themes -> themes -> style.css uses mulitple calculations like this
margin-bottom: calc(
var(--leading-trim-start, var(--default-leading-trim-start)) -
var(--line-height, calc(1em * var(--default-line-height))) / 2
)
When you try to build the project (npm run build), it causes parsing error:
Expecting end of input, "ADD", "SUB", "MUL", "DIV", got unexpected "RPAREN"
Now I just want to know how are we supposed to use themes with react scripts 4.0.3? I can't really update to newer version of react scripts.
The text was updated successfully, but these errors were encountered: