lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Segmentation Fault error on calc()/clamp() expression

Open illarionvk opened this issue 2 years ago • 2 comments

The transform() compiler module crashes the Node process with a segfault on a calc()/clamp() expression:

.item {
  width: calc(100% - clamp(1.125rem, 1.25vw, 1.2375rem) - clamp(1.125rem, 1.25vw, 1.2375rem));
}

The playground also shows index out of bounds error and stops responding to code changes.

If I use the css declaration directly in a browser, the element calculates the width correctly.

Tested on lightningcss version 1.22.0, Node versions 18.18.0 and 16.19.0, amd64 Linux

Screenshot 2023-10-23 at 12 39 20

Related issue from last year: https://github.com/parcel-bundler/lightningcss/issues/166

illarionvk avatar Oct 23 '23 10:10 illarionvk

I tried excluding the ClampFunction feature, but it still crashes.

illarionvk avatar Oct 23 '23 10:10 illarionvk

Please raise the priority of this error.

yisibl avatar Dec 29 '23 14:12 yisibl