Go into the file packages/nuxt/src/module.ts and comment out the line disabling calc for cssnano:
Run pnpm run build:all
cd into packages/nuxt
Run pnpm run dev:build
You will see vite starting to build the client and then just hanging up because the calc plugin isn't able to work with the expression calc(infinity * 1s) used inside packages/sit-onyx/src/components/OnyxInput/OnyxInput.vue.
Version
9.0.1
Environment
System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Max
Memory: 932.81 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
I got here as I encountered a bug within a Nuxt Js app using css with the statement calc(infinity *1s). It worked during development but at build time vite just hung up so I investigated further. Turns out nuxt uses postcss with nanocss by default. Nanocss again includes this plugin which causes the issue.
It would be really great if the plugin could support these relatively new but stable constants. Thanks
Describe the bug
Running the plugin fails on css containing a calculation using constant values. (See: https://developer.mozilla.org/en-US/docs/Web/CSS/calc-constant)
Expected behaviour
I'd expect the plugin to support calc-constant values or to at least not touch calculations it can't optimize to not cause such issues.
Steps to reproduce
Either create a new nuxt app and use
calc(infinity * 1px)
somewhere inside the css and try to run a build or:Check out https://github.com/SchwarzIT/onyx
Run
pnpm i
Go into the file
packages/nuxt/src/module.ts
and comment out the line disabling calc for cssnano:Run
pnpm run build:all
cd into
packages/nuxt
Run
pnpm run dev:build
You will see vite starting to build the client and then just hanging up because the calc plugin isn't able to work with the expression
calc(infinity * 1s)
used insidepackages/sit-onyx/src/components/OnyxInput/OnyxInput.vue
.Version
9.0.1
Environment
Package details
Additional context
I got here as I encountered a bug within a Nuxt Js app using css with the statement
calc(infinity *1s)
. It worked during development but at build time vite just hung up so I investigated further. Turns out nuxt uses postcss with nanocss by default. Nanocss again includes this plugin which causes the issue.It would be really great if the plugin could support these relatively new but stable constants. Thanks