Running npm run build using robox build produces JavaScript files inside .robo/build/ that contain unresolved deep relative import paths such as:
import { useRoom } from "../../../src/hooks/useRoomContext";
This results in a fatal error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../src/hooks/useRoomContext'
Expected behavior
- Robo should bundle or rewrite all imports during build.
- Robo should respect tsconfig.json path aliases (e.g. @/hooks/useRoomContext).
- At the very least, Robo should copy over all necessary source files to the output folder if it's going to reference them directly.
How to reproduce:
- Use @/hooks/useRoomContext in a source file.
- Run robox build.
- Open .robo/build/context/RoomContext.js or any other generated file.
- See broken import like:
import { useRoom } from "../../../src/hooks/useRoomContext";
- Build or deploy fails with ERR_MODULE_NOT_FOUND.
Running
npm run buildusing robox build produces JavaScript files inside .robo/build/ that contain unresolved deep relative import paths such as:This results in a fatal error:
Expected behavior
How to reproduce: