kirklin / kirklin/postcss-px-conversion

AtRule is not a constructor

Open
#3 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
63
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

![image](https://github.com/user-attachments/assets/462dc620-4574-42fd-a9f2-82ba842cb540)
postcss版本:8.4.39
安装postcss-px-conversion后运行,报错”xxxAtRule is not a constructor“

### Reproduction

plugins: [ autoprefixer(), postcssPxConversion({ unitType: 'px', unitPrecision: 5, viewportWidth: 375, viewportUnit: 'vw', fontViewportUnit: 'vw', allowedProperties: ['*'], excludedProperties: [], selectorBlacklist: [], minPixelValue: 1, allowMediaQuery: true, replaceRules: true, excludeFiles: [/pad-css\.(scss|css|less)/, /uno\.(scss|css|less)/], includeFiles: [], enableLandscape: true, landscapeUnit: 'vh', landscapeViewportWidth: 768, enablePerFileConfig: true, viewportWidthComment: 'viewport-width', }), postcssPxConversion({ unitType: 'px', unitPrecision: 5, viewportWidth: 375, viewportUnit: 'vw', fontViewportUnit: 'vw', allowedProperties: ['*'], excludedProperties: [], selectorBlacklist: [], minPixelValue: 1, allowMediaQuery: true, replaceRules: true, excludeFiles: [], includeFiles: [/pad-css\.(scss|css|less)/], enableLandscape: true, landscapeUnit: 'vh', landscapeViewportWidth: 768, enablePerFileConfig: true, viewportWidthComment: 'viewport-width', }),]

### System Info

```Shell
System:
OS: macOS 14.1
CPU: (11) arm64 Apple M3 Pro
Memory: 29.98 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
Yarn: 1.22.21 - /opt/homebrew/bin/yarn
npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
pnpm: 8.12.0 - ~/Library/pnpm/pnpm
Browsers:
Chrome: 126.0.6478.127
Safari: 17.1
Safari Technology Preview: 18.0
```

### Validations

- [X] Follow our [Code of Conduct](https://github.com/kirklin/.github/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guide](https://github.com/kirklin/contribute).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with postcss-px-conversion on PostCSS 8.4.39 using the configuration in the issue, especially the two plugin instances and file patterns. Trace the plugin's PostCSS integration to identify why an AtRule is not constructible; done means the reported configuration runs without the constructor error and performs the expected pixel conversion.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.