react-jsx does not work with Preact
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với các tùy chọn tsconfig được báo cáo và một bản build microbundle, sau đó kiểm tra cách microbundle truyền các thiết lập JSX cho TypeScript. Issue được hoàn tất khi react-jsx với jsxImportSource được đặt thành preact không còn gây ra các lỗi xung đột jsxFactory hoặc fragment-factory.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi
Error
I've recently made the switch to microbundle for a project that uses Preact and TypeScript.
Following the docs, and me having the latest version of TypeScript, I put the following in my tsconfig:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact",
//...
}
}
However when building with microbundle I get the following error:
rpt2: options error TS5089: Option 'jsxFactory' cannot be specified when option 'jsx' is 'react-jsx'.
This seems weird behaviour as I have not specified the jsxFactory.
Combined with this I also get an error about the 'jsxFragmentFactory' having to be provided to use JSX Fragments, but I presume that is due to the fact the the jsxFactory is somehow incorrect.
I tried hardcoding the values from the config in my script (without success) by doing the following
microbundle --jsx react-jsx --jsxImportSource preact
Possible solution
I've been able to get microbundle working if I switch back to the tsconfig for older versions of TypeScript, so I'll be opting into this behaviour for now. For reference this is what the old config is:
{
"compilerOptions": {
"jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
//...
}
}
- Ngôn ngữ chính
- JavaScript
- Star
- 8.1k
- Fork
- 358
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của developit/microbundle
-
CSS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
developit/microbundle#1002 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
developit/microbundle#789 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
developit/microbundle#1100 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
developit/microbundle#1094 · 1 bình luận ·
-
Disable minification by default Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
developit/microbundle#1093 · 3 bình luận · 1 reaction ·
Tất cả issue của developit/microbundle
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
nightscout/nocturne#1414 ·
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·