diff --git a/.changeset/twenty-trains-bathe.md b/.changeset/twenty-trains-bathe.md new file mode 100644 index 0000000000..547ed15a58 --- /dev/null +++ b/.changeset/twenty-trains-bathe.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/world": patch +--- + +Fixed an issue with worldgen when using a different `rootDir` from the current working directory, where worldgen would read system source files from the wrong place. diff --git a/packages/world/ts/node/render-solidity/worldgen.ts b/packages/world/ts/node/render-solidity/worldgen.ts index 3305b8b27b..097558e681 100644 --- a/packages/world/ts/node/render-solidity/worldgen.ts +++ b/packages/world/ts/node/render-solidity/worldgen.ts @@ -49,7 +49,7 @@ export async function worldgen({ await Promise.all( systems.map(async (system) => { - const data = await fs.readFile(system.sourcePath, "utf8"); + const data = await fs.readFile(path.join(rootDir, system.sourcePath), "utf8"); // get external functions from a contract const { functions, errors, symbolImports } = contractToInterface(data, system.label); const imports = symbolImports.map(