🐛 Describe the bug
A TypeScript type error occurs in modules/webcontainers/hooks/transformer.ts when transforming a TemplateFolder into a FileSystemTree. The error is caused by a mismatch between custom file/directory interfaces and @webcontainer/api types (DirectoryNode, FileNode, SymlinkNode).
🔁 Steps to Reproduce
Steps to reproduce the behavior:
- Go to
modules/webcontainers/hooks/transformer.ts
- Use
transformToWebContainerFormat(template) function
- Run TypeScript compilation (
tsc)
- See type error in directory assignment
✅ Expected Behavior
The function should correctly transform TemplateFolder into a valid FileSystemTree compatible with @webcontainer/api without type errors.
❌ Actual Behavior
TypeScript throws an error:
Type 'FileSystemTree' is not assignable to type '{ [key: string]: WebContainerFile | WebContainerDirectory; }'.
Type 'DirectoryNode | FileNode | SymlinkNode' is not assignable to type 'WebContainerFile | WebContainerDirectory'.
📸 Screenshots
Not applicable
🌱 Contributor Checklist
💻 Environment
- Browser: Not applicable (TypeScript build issue)
- Device: Desktop
- OS: Any (Windows/Linux/macOS)
📝 Additional Context
The issue appears due to mixing custom WebContainerFile/WebContainerDirectory structures with official @webcontainer/api types. Alignment with FileNode and DirectoryNode is required to resolve the mismatch.
🐛 Describe the bug
A TypeScript type error occurs in
modules/webcontainers/hooks/transformer.tswhen transforming aTemplateFolderinto aFileSystemTree. The error is caused by a mismatch between custom file/directory interfaces and@webcontainer/apitypes (DirectoryNode,FileNode,SymlinkNode).🔁 Steps to Reproduce
Steps to reproduce the behavior:
modules/webcontainers/hooks/transformer.tstransformToWebContainerFormat(template)functiontsc)✅ Expected Behavior
The function should correctly transform
TemplateFolderinto a validFileSystemTreecompatible with@webcontainer/apiwithout type errors.❌ Actual Behavior
TypeScript throws an error:
📸 Screenshots
Not applicable
🌱 Contributor Checklist
💻 Environment
📝 Additional Context
The issue appears due to mixing custom
WebContainerFile/WebContainerDirectorystructures with official@webcontainer/apitypes. Alignment withFileNodeandDirectoryNodeis required to resolve the mismatch.