Dynamic Worker fails to resolve relative imports between modules in a subdirectory
mattfysh opened ·
## Dynamic Worker fails to resolve relative imports between modules in a subdirectory
### Reproduction
The following code works on Cloudflare but fails on celld:
```js const dyn = env.LOADER.load({ compatibilityDate: '2026-01-01', mainModule: 'dir/a.js', modules: { 'dir/a.js': ` import { x } from './b.js' export default { fetch() { return new Response(String(x)) } } `, 'dir/b.js': `export const x = 55`, }, })
return dyn.getEntrypoint().fetch(new Request('http://example.com')) ```
### Expected behavior
HTTP 200 with response body `55`, as observed on Cloudflare.
### Actual behavior
The request fails with:
``` Worker failed: rejected: Error: instantiate: <none> ```
The celld logs contain:
``` WARN celld::js::modules: resolve: no stub for specifier spec=./b.js ```
### Additional context
The issue appears to be relative module resolution: `./b.js` should resolve relative to the importing module (`dir/a.js`), yielding `dir/b.js`, which is present in the supplied module map.
bartlomiejuassigned bartlomiejulast month on GitHub
- BA
Thanks for the report. It's not fixed and will be released in the next version.
bartlomiejureferenced 81d1c52fb5belast month on GitHub
bartlomiejureferenced 0aa22f091625last month on GitHub
bartlomiejureferenced 46692d514ac3last month on GitHub
ryreferenced def3ad02192dlast month on GitHub
bartlomiejureferenced bab562b22376last month on GitHub
bartlomiejureferenced af69bb4337c5last month on GitHub
bartlomiejureferenced bad4649d01f0last month on GitHub
- MA
hey @bartlomieju 👋 thanks for the fix! is it possible to see the individual commit? curious to learn about the celld architecture thru the bug fix. cheers!
bartlomiejumentionedlast month on GitHub
bartlomiejusubscribedlast month on GitHub
- BA
@mattfysh nope, we only do release commits in this repo that include all the changes between versions.
mattfyshmentionedlast month on GitHub
mattfyshsubscribedlast month on GitHub
knownasilyareferenced this in fix(execute): resolve Worker Loader imports on celld 0.6 #26last month on GitHub