Skip to content

importing breaks on recompiling tsx files #1037

@GlassBricks

Description

@GlassBricks

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>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions