microsoft / microsoft/vscode-wasm
wit async func wit2ts error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 456
- Forks
- 40
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
world calculator {
use types.{ operation, error-code };
import log: func(msg: string);
export calc: func(o: operation) -> result<u32, error-code>;
export get: async func() -> string;
}
wasm-component-model@1.0.0 generate:model
wit2ts --outDir ./src ./wit
Debugger attached.
Failed to process document
TypeError: Cannot read properties of undefined (reading 'world')
at Object.isWorld (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit-json.js:146:29)
at SymbolTable.resolveOwner (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:702:30)
at WorldExportFunctionEmitter.getOwner (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:2789:60)
at new MemberEmitter (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:2767:27)
at new FunctionEmitter (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:2852:9)
at new WorldExportFunctionEmitter (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:2903:9)
at new (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:3684:13)
at WorldEmitter.build (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:2057:48)
at PackageEmitter.build (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:1889:21)
at DocumentEmitter.build (/Users/lamb/Downloads/vscode-extension-samples-main/wasm-component-model/node_modules/@vscode/wasm-component-model/lib/tools/wit2ts.js:1797:24)
Contributor guide
No contributing guide indexed for this repository
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
Reproduce the failure with wasm-component-model@1.0.0 generate:model and the shown calculator WIT document. Start with the stack-trace locations in lib/tools/wit-json.js and lib/tools/wit2ts.js, especially isWorld and WorldExportFunctionEmitter. Done means the async world export no longer causes the generator to fail and TypeScript output is produced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, wasm
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100