Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

wit async func wit2ts error

Open
#240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript, wasm
Domain
tooling

Research direction

Reproduce the failure with [email protected] 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.

Description

bug
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;
}

[email protected] 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)

Dominant language
TypeScript
Stars
456
Forks
40
Avg merge
3d 17h
Merged PRs (30d)
3

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-wasm

All issues in microsoft/vscode-wasm

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.