Forge project inside monorepo

Hey there,

we created a new Forge extension inside our monorepo which is using yarn v1 workspaces. Unfortunately we get the following error when running forge tunnel:

Error: Bundling failed: Module not found: Error: Can't resolve '@forge/ui' in '/app/src', Module not found: Error: Can't resolve '@forge/api' in '/app/src', Module not found: Error: Can't resolve '@questmate/openapi-spec' in '/app/src', Module not found: Error: Can't resolve '@forge/ui' in '/app/src', Module not found: Error: Can't resolve '@forge/api' in '/app/src', [tsl] ERROR

This is likely because dependencies are hoisted to the root node_modules folder of the mono repo. While we could manually hoist the forge dependencies to the integration folder, we’d also love to make use of our other libraries and types in the workspace.

What’s the recommended way using forge in conjunction with yarn workspaces?

/cc @Dmitrii

1 Like