This is a weird bug, found when using .tsx files with an unofficial jsx tstl plugin.
When recompiling a .tsx file (not .ts) with changes, and a corresponding .lua file already exists, the resulting .lua output requires break. Specifically, the folder path name is repeated inside the require for every .tsx file is completed, so 5 recompiles later, require("folder.foo") becomes require("folder.folder.folder.folder.folder.folder.foo").
TSTL also shows an error Could not resolve path 'folder.folder.(...).foo' in file folder/file.lua.
This still happens without any tstl plugins and without any jsx, and both using --watch and running tstl again manually.
Workaround is to delete the .lua file before recompiling, before it needs to be used.
Possibly related issue: trying to import a .tsx file from another ts file results in the error Could not resolve require path '<the tsx file>' in file <the importing file>.
This is a weird bug, found when using
.tsxfiles with an unofficial jsx tstl plugin.When recompiling a
.tsxfile (not.ts) with changes, and a corresponding.luafile already exists, the resulting.luaoutputrequires break. Specifically, the folder path name is repeated inside therequirefor every .tsx file is completed, so 5 recompiles later,require("folder.foo")becomesrequire("folder.folder.folder.folder.folder.folder.foo").TSTL also shows an error
Could not resolve path 'folder.folder.(...).foo' in file folder/file.lua.This still happens without any tstl plugins and without any jsx, and both using
--watchand runningtstlagain manually.Workaround is to delete the .lua file before recompiling, before it needs to be used.
Possibly related issue: trying to import a
.tsxfile from another ts file results in the errorCould not resolve require path '<the tsx file>' in file <the importing file>.