Forge cannot find module error when using Forge Tunnel with NodeJS (on Windows)

I appear to be experiencing a similar error to Forge cannot find module when using Forge Tunnel with native NodeJS on windows.

Anyone else having this issue?

ERROR   15:37:09.827  f1c52e48-ef87-47b1-aa5d-7045181614cb  Error: Cannot find module 'D:\Source\jira-plugins\Cloud-Tempus-Worklog-Gadget\.forge\tunnel-output\index.js'
Require stack:
- D:\Source\jira-plugins\Cloud-Tempus-Worklog-Gadget\.forge\tunnel-output\__forge_wrapper__.cjs
- D:\Source\jira-plugins\Cloud-Tempus-Worklog-Gadget\.forge\tunnel-output\__forge__.cjs
- C:\Users\taylorc\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@forge\tunnel\out\sandbox\sandbox-runner.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1517:15)
    at wrapResolveFilename (node:internal/modules/cjs/loader:1071:27)
    at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1095:10)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1122:12)
    at Module._load (node:internal/modules/cjs/loader:1294:5)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.require (node:internal/modules/cjs/loader:1617:12)
    at require (node:internal/modules/helpers:153:16)
    at g (D:\Source\jira-plugins\Cloud-Tempus-Worklog-Gadget\.forge\tunnel-output\__forge_wrapper__.cjs:2:1203024)
    at new Promise (<anonymous>) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\Source\\jira-plugins\\Cloud-Tempus-Worklog-Gadget\\.forge\\tunnel-output\\__forge_wrapper__.cjs',
    'D:\\Source\\jira-plugins\\Cloud-Tempus-Worklog-Gadget\\.forge\\tunnel-output\\__forge__.cjs',
    'C:\\Users\\taylorc\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@forge\\tunnel\\out\\sandbox\\sandbox-runner.js'
  ]
}

Hi @taylor.chase,

Your trace says something narrower than the tunnel being broken. Both files in that require stack are Forge’s own, and both loaded. @forge/bundler writes __forge__.cjs and __forge_wrapper__.cjs into tunnel-output itself, one as the runtime loader and one as the wrapper. The file it could not find, index.js, is yours. The manifest schema describes handler as the method within the index.js function that gets called to invoke it.

The runtime arrived. Your bundled code did not. I’d look in .forge\tunnel-output at what is sitting next to those two .cjs files, and check whether the bundle step said anything before the tunnel came up.

Different failure from 74967, which you linked. That was Forge parsing the bundle path wrongly on Windows, in @forge/node-runtime writing to a temp directory, and it got fixed CDN-side in 2023. Yours is @forge/tunnel writing into the project folder.

What does your manifest declare as the handler?