opentiny / opentiny/tiny-editor
🐛 [Bug]: cannot npm start in Angular project, TS2307: Cannot find module 'html2canvas' or its corresponding type declaration.
Open
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 535
- Forks
- 71
- Avg merge
- 6h 50m
- Merged PRs (30d)
- 2
Description
Version
latest
Link to minimal reproduction
在一个 Angular 项目中,安装 @opentiny/fluent-editor,然后本地启动报错:
Error: node_modules/@opentiny/fluent-editor/types/tools/screenshot.d.ts:1:71 - error TS2307: Cannot find module 'html2canvas' or its corresponding type declaration.
import { default as html2canvas, Options as Html2CanvasOptions } from 'html2canvas';
其实并没有配置 screenshot 模块,也没有安装 html2canvas 依赖。
该问题在 Vite + Vue 项目里不会出现。
Step to reproduce
如上
What is expected
No response
What is actually happening
No response
What is your project name
Wiki
Any additional comments (optional)
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting node_modules/@opentiny/fluent-editor/types/tools/screenshot.d.ts and the package dependency declarations, then reproduce the failure with npm start in an Angular project without screenshot configuration or html2canvas installed. Done means the Angular project starts successfully without requiring html2canvas when the screenshot module is unused.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100