actual
actual copied to clipboard
[Bug]: @actual-app/api does not work when bundled
Verified issue does not already exist?
- [X] I have searched and found no existing issue
- [X] I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file)
What happened?
I was trying to use the API in a Next.js environment. But it bundles the dependencies into chunks, and when @actual/api uses "__dirname" to find the root path, it ends up in my disk root, thus not able to find the migrations folder.
It does not make sense to find a folder using __dirname as in: https://github.com/actualbudget/actual/blob/61bffa3d31e96263664ab96b1bc11e9164ce653f/packages/loot-core/src/platform/server/fs/index.electron.ts#L9-L15
There should be a way to set this rootPath manually, maybe instead of setting the data path, as everything would be under the root path, or at least setting the migrations path.
Where are you hosting Actual?
Locally via Yarn
What browsers are you seeing the problem on?
Firefox
Operating System
Windows 11