opral / inlang-sdk

0 stars 0 forks source link

investigate "wrong url" bug in sherlock #170

Closed samuelstroschein closed 1 month ago

samuelstroschein commented 1 month ago

@samuel.stroschein said in SHERL-102:

this seems to be a bug that is unrelated to a project. i'll try to look into it today.

I suspect that the WASM sqlite can't be loaded in sherlock.

samuelstroschein commented 1 month ago
CleanShot 2024-09-06 at 16.27.44@2x.png

Suspicion confirmed. Creating an in memory database fails with "URL invalid". Investigation pending.

samuelstroschein commented 1 month ago

Bug found. Has to do with Sherlock running in Electron which is operating in CommonJS instead of ESM.

The SQLite dependency uses import.meta which is not available in CJS. The corresponding new URL(import.meta) subsequently fails.

CleanShot 2024-09-06 at 16.31.09@2x.png
samuelstroschein commented 1 month ago

Aaaaaaaaaaand i proudly present sherlock loading a project

opening plugins from the file system is not working yet. Also, i need to figure out how to polyfill import.meta

CleanShot 2024-09-06 at 16.35.28@2x.png
samuelstroschein commented 1 month ago

Fixed in https://github.com/opral/monorepo/commit/9b97457e8ad6018ab8a69827c8eb64b9f076aced

I can now open inlang projects. Will work on MESDK-214 now