How to use async function?
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- tooling
调研方向
Start by reproducing the async processPostCSS example and capture the error from postcssrc(ctx), since no file or test is identified in the issue. Done means determining why the async API fails and documenting or fixing the behavior so the example returns css successfully.
由索引模型根据 Issue 内容生成。
描述
I've never been able to successfully use the async API in my application and I'm wondering why? Do you have any thoughts?
I'm using:
async function processPostCSS(src = '') {
const ctx = { parser: true, map: 'inline' };
const { plugins } = await postcssrc(ctx)
const { css } = await postcss([postcssNested(), autoprefixer(), ...plugins]).process(src, { from: undefined })
return css
}
postcssrc(ctx) causes this function to break for some reason that I don't understand. If I change to the synchronous API it works fine. I'm not sure how to tell what the error is, all I know is that it doesn't return the css when I use the postcss-load-config async API
What am I doing incorrectly?
- 主要语言
- JavaScript
- 星标
- 661
- 派生
- 76
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
postcss/postcss-load-config 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 25/100
postcss/postcss-load-config#266 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
postcss/postcss-load-config#248 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
postcss/postcss-load-config#225 · 13 条评论 ·
-
难度 3/5 1-2 天 新手友好度 38/100
postcss/postcss-load-config#221 · 4 条评论 ·
-
priority: medium semver: minor type: feature
难度 5/5 一周以上 新手友好度 25/100
postcss/postcss-load-config#183 · 1 条评论 · 4 个 reaction ·
查看 postcss/postcss-load-config 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
Forrest-Technologies/drover#1040 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 90/100
erkamyaman/rust-anything#702 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
erkamyaman/unslop-anything#231 ·
维护者通常 1 天内回复