You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL; DR: When an aliased subdirectory has the same name as the project folder, tsc-alias can fail to replace import aliases, causing imports to fail at runtime.
I use tsc-alias to bundle a @shared/ library between my client and server code. Recently this broke when I tried adding @shared/ to my service which happens to live under games/pool/.
The problem is that the shared library also has a folder that includes a folder named pool. This causes getProjectDirPathInOutDir to return a bad array with an incorrect path:
This causes an incorrect path in relativeOutPathToConfigDir to be returned, which then results in bad values for basePath, for example: /home/acorn/cloud/Projects/js/foony/services/games/pool/lib/shared/src/games/pool instead of '/home/acorn/cloud/Projects/js/foony/services/games/pool/lib/services/games/pool'
TL; DR: When an aliased subdirectory has the same name as the project folder, tsc-alias can fail to replace import aliases, causing imports to fail at runtime.
I use
tsc-alias
to bundle a@shared/
library between myclient
andserver
code. Recently this broke when I tried adding@shared/
to my service which happens to live undergames/pool/
.The problem is that the shared library also has a folder that includes a folder named
pool
. This causesgetProjectDirPathInOutDir
to return a bad array with an incorrect path:The correct path should be:
[ "/home/acorn/cloud/Projects/js/foony/services/games/pool/lib/services/games/pool" ]
This causes an incorrect path in
relativeOutPathToConfigDir
to be returned, which then results in bad values forbasePath
, for example:/home/acorn/cloud/Projects/js/foony/services/games/pool/lib/shared/src/games/pool
instead of'/home/acorn/cloud/Projects/js/foony/services/games/pool/lib/services/games/pool'
My project structure looks like this:
The text was updated successfully, but these errors were encountered: