5t3ph / 5t3ph/eleventy-plugin-lightningcss
ERRORS: Having trouble rendering/compiling css template + Browser queries must be an array or string. Got object.
- Ngôn ngữ chính
- JavaScript
- Star
- 45
- Fork
- 4
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Enabling the plugin via `eleventyConfig.addPlugin(lightningCSS);` in `.eleventy.js` produces the following error:
````
[11ty] 1. Having trouble rendering css template ./src/Box.css (via TemplateContentRenderError)
[11ty] 2. Having trouble compiling template ./src/Box.css (via TemplateContentCompileError)
[11ty] 3. Browser queries must be an array or string. Got object. (via BrowserslistError)
[11ty]
[11ty] Original error stack trace: BrowserslistError: Browser queries must be an array or string. Got object.
[11ty] at checkQueries (/projects/eleventy/node_modules/browserslist/index.js:387:11)
[11ty] at browserslist (/projects/eleventy/node_modules/browserslist/index.js:398:3)
[11ty] at Object.compile (/projects/eleventy/node_modules/@11tyrocks/eleventy-plugin-lightningcss/.eleventy.js:100:43)
[11ty] at CustomEngine.compile (/projects/eleventy/node_modules/@11ty/eleventy/src/Engines/Custom.js:201:7)
[11ty] Wrote 0 files in 0.01 seconds (v2.0.1)
````
If I rename or delete `Box.css` I get the same error, but for the next CSS file in my project (`/src/Center.css`).
I'm configuring `browserslist` in my `package.json`, but I've also tried the default method and produced the same error.
[Contents of `.eleventy.js`](https://github.com/5t3ph/eleventy-plugin-lightningcss/files/13572887/eleventy.txt)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
The error originates in the plugin's compile function at .eleventy.js line 100, where browserslist receives an object instead of an array/string. Start by examining the plugin's source to see how the browserslist query is constructed. Check the project's package.json for browserslist configuration and ensure it's valid. Run the plugin in a minimal Eleventy project to reproduce the issue and trace the data flow.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- build-system, tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 40/100