Skip to content

Conversation

Copy link

Copilot AI commented Jan 7, 2026

The Foxglove extension build failed with TS2345 error because TypeScript couldn't resolve type definitions for the imported WASM module. The declaration file was named cloudini_wasm.d.ts but the code imports cloudini_wasm_single.js, causing a name mismatch.

Changes

  • Renamed declaration file: cloudini_wasm.d.tscloudini_wasm_single.d.ts to match the imported JS module
  • Updated type import: PointCloudConverter.tsx now imports from "./cloudini_wasm_single"
  • Fixed module declaration: Changed from declare module "./cloudini_wasm_single.js" wrapper to proper default export
  • Updated tsconfig.json: Reference to renamed declaration file
  • Added to .gitignore: *.foxe build artifacts

The fix aligns with TypeScript's automatic type resolution convention where foo.d.ts provides types for foo.js.

// Before (doesn't work - name mismatch)
import CloudiniModule from "./cloudini_wasm_single.js";
import type { CloudiniWasmModule } from "./cloudini_wasm";  // Can't find types

// After (works - names match)
import CloudiniModule from "./cloudini_wasm_single.js";
import type { CloudiniWasmModule } from "./cloudini_wasm_single";
Original prompt

This section details on the original issue you should resolve

<issue_title>Error and fix for building .foxe file</issue_title>
<issue_description>I tried following the instructions of the cloudini_foxglove READ.md to create the .foxe file.

However, trying to run npm run package resulted in the following error:

user@user_pc:~/git/cloudini/cloudini_foxglove$ npm run package

> foxglove-cloudini-converter@0.11.0 package
> foxglove-extension package -o release/cloudini.foxglove-cloudini-converter-$npm_package_version.foxe

Executing prepublish script 'npm run foxglove:prepublish'...

> foxglove-cloudini-converter@0.11.0 foxglove:prepublish
> foxglove-extension build --mode production

Building...
Error: build failed: Errors:
[tsl] ERROR in /home/user/git/cloudini/cloudini_foxglove/src/PointCloudConverter.tsx(10,48)
      TS2345: Argument of type '(module: CloudiniWasmModule) => void' is not assignable to parameter of type '(value: {}) => void | PromiseLike<void>'.
  Types of parameters 'module' and 'value' are incompatible.
    Type '{}' is missing the following properties from type 'CloudiniWasmModule': _cldn_ComputeCompressedSize, _cldn_DecodeCompressedData, _cldn_DecodeCompressedMessage, _cldn_GetDecompressedSize, and 12 more.
    at /home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/dist/build.js:65:28
    at /home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/node_modules/webpack/lib/HookWebpackError.js:67:2
    at Hook.eval [as callAsync] (eval at create (/home/user/git/cloudini/cloudini_foxglove/node_modules/tapable/lib/HookCodeFactory.js:31:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/user/git/cloudini/cloudini_foxglove/node_modules/tapable/lib/Hook.js:21:14)
    at Cache.shutdown (/home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/node_modules/webpack/lib/Cache.js:154:23)
    at /home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/node_modules/webpack/lib/Compiler.js:1379:15
    at Hook.eval [as callAsync] (eval at create (/home/koen/git/cloudini/cloudini_foxglove/node_modules/tapable/lib/HookCodeFactory.js:31:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/user/git/cloudini/cloudini_foxglove/node_modules/tapable/lib/Hook.js:21:14)
    at Compiler.close (/home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/node_modules/webpack/lib/Compiler.js:1372:23)
    at /home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/dist/build.js:55:22
Error: npm failed with exit code 1
    at ChildProcess.<anonymous> (/home/user/git/cloudini/cloudini_foxglove/node_modules/create-foxglove-extension/dist/package.js:156:24)
    at ChildProcess.emit (node:events:524:28)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)

Some AI help suggested that this might be because of a missing .d.ts file. So I tried to see what would happen when I renamed cloudini_wasm.d.ts to cloudini_wasm_single.d.ts and that indeed worked. It then successfully created a .foxe file which I could successfully use to visualize compressed point cloud messages in Foxglove.

I do not understand enough of the processes behind creating the .foxe file, but could it be that there is something missing in the installation process or instructions?</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Renamed cloudini_wasm.d.ts to cloudini_wasm_single.d.ts to match the imported JavaScript file name
- Updated PointCloudConverter.tsx to import types from cloudini_wasm_single
- Updated tsconfig.json to reference the new file name
- Modified module declaration to use default export instead of module wrapper
- Added *.foxe to .gitignore to prevent committing build artifacts
- Verified successful build with npm run package

Co-authored-by: facontidavide <2822888+facontidavide@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error when building .foxe file Fix TypeScript declaration file naming for Foxglove extension build Jan 7, 2026
Copilot AI requested a review from facontidavide January 7, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error and fix for building .foxe file

2 participants