René's URL Explorer Experiment


Title: Dots in module path breaks Lua import in a non-bundle compilation · Issue #1445 · TypeScriptToLua/TypeScriptToLua · GitHub

Open Graph Title: Dots in module path breaks Lua import in a non-bundle compilation · Issue #1445 · TypeScriptToLua/TypeScriptToLua

X Title: Dots in module path breaks Lua import in a non-bundle compilation · Issue #1445 · TypeScriptToLua/TypeScriptToLua

Description: Abstract tstl fails to produce valid lua code from a subset of valid (accordingly to tstl docs) code if ts file names contain dots in paths. This problem may naturally arise, for example, when compiling from Purescript to JS and then fro...

Open Graph Description: Abstract tstl fails to produce valid lua code from a subset of valid (accordingly to tstl docs) code if ts file names contain dots in paths. This problem may naturally arise, for example, when comp...

X Description: Abstract tstl fails to produce valid lua code from a subset of valid (accordingly to tstl docs) code if ts file names contain dots in paths. This problem may naturally arise, for example, when comp...

Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dots in module path breaks Lua import in a non-bundle compilation","articleBody":"### Abstract\r\n`tstl` fails to produce valid `lua` code from a subset of valid (accordingly to `tstl` docs) code if `ts` file names contain dots in paths.\r\n\r\nThis problem may naturally arise, for example, when compiling from Purescript to JS and then from JS to Lua using tstl.\r\n\r\nThe example is not the natural use case for tstl, however, the bug is the bug.\r\n### Example\r\nLet's say we have two files:\r\n`./src/Foo.Bar/index.ts`\r\n```ts\r\nexport const answer: number = 42;\r\n```\r\n`./src/Qux/index.ts`\r\n```ts\r\nimport {answer} from \"./Foo.Bar\";\r\nexport const printAnswer = () => print(answer)\r\n```\r\nSo `import {answer} from \"./Foo.Bar\";` will be compiled (in a non-bundle mode) to\r\n```lua\r\nlocal ____Foo_2EBar = require(\"Foo.Bar.index\")\r\nlocal answer = ____Foo_2EBar.answer\r\n```\r\nand `lua` will be searching at `./Foo/Bar/index.lua\"` for that module.\r\n\r\nThat will result an error:\r\n```\r\nlua: ./Qux/index.lua:3: module 'Foo.Bar.index' not found:\r\n        no field package.preload['Foo.Bar.index']\r\n        no file './Foo/Bar/index.lua'\r\n        no file '/usr/local/share/lua/5.1/Foo/Bar/index.lua'\r\n        no file '/usr/local/share/lua/5.1/Foo/Bar/index/init.lua'\r\n        no file '/usr/local/lib/lua/5.1/Foo/Bar/index.lua'\r\n        no file '/usr/local/lib/lua/5.1/Foo/Bar/index/init.lua'\r\n        no file '/usr/share/lua/5.1/Foo/Bar/index.lua'\r\n        no file '/usr/share/lua/5.1/Foo/Bar/index/init.lua'\r\n        no file './Foo/Bar/index.so'\r\n        no file '/usr/local/lib/lua/5.1/Foo/Bar/index.so'\r\n        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/Foo/Bar/index.so'\r\n        no file '/usr/lib/lua/5.1/Foo/Bar/index.so'\r\n        no file '/usr/local/lib/lua/5.1/loadall.so'\r\n        no file './Foo.so'\r\n        no file '/usr/local/lib/lua/5.1/Foo.so'\r\n        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/Foo.so'\r\n        no file '/usr/lib/lua/5.1/Foo.so'\r\n        no file '/usr/local/lib/lua/5.1/loadall.so'\r\nstack traceback:\r\n        [C]: in function 'require'\r\n        ./Qux/index.lua:3: in main chunk\r\n        [C]: in function 'require'\r\n        ./main.lua:3: in main chunk\r\n        [C]: ?\r\n```\r\n### Soulution\r\nWhen compiled to a file `./dist/Foo.Bar.Baz/index.lua`, split it's name by dots (excluding extension) and put the file into directory `./Foo/Bar/Baz`.\r\nThis will fix module resolution for `lua`.\r\nSo basically the ts directory\r\n```ls\r\n.\r\n├── Foo/\r\n│   └── index.ts\r\n├── Foo.Bar/\r\n│   └── index.ts\r\n├── Foo.Bar.Baz/\r\n│   └── index.ts\r\n├── Qux/\r\n│   └── index.ts\r\n└── index.ts\r\n```\r\nshould be compiled into\r\n```ls\r\n.\r\n├── Foo/\r\n│   ├── index.lua\r\n│   └── Bar/\r\n│       └── index.lua\r\n│       └── Baz/\r\n│           └── index.lua\r\n├── Qux/\r\n│   └── index.lua\r\n└── index.lua\r\n```\r\ninstead of\r\n```ls\r\n.\r\n├── Foo/\r\n│   └── index.lua\r\n├── Foo.Bar/\r\n│   └── index.lua\r\n├── Foo.Bar.Baz/\r\n│   └── index.lua\r\n├── Qux/\r\n│   └── index.lua\r\n└── index.lua\r\n```","author":{"url":"https://github.com/Renegatto","@type":"Person","name":"Renegatto"},"datePublished":"2023-05-20T11:38:12Z","url":"https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:021b1a18-82d5-3b85-8cf7-607610dd36ed
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8BFC:928E2:7C6E8F:A82C92:6B00DF35
html-safe-noncea34cbd9d87e6d77cdb62a42043e49f51ab29e353534fac6c96c0e4dfbcb210ad
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkZDOjkyOEUyOjdDNkU4RjpBODJDOTI6NkIwMERGMzUiLCJ2aXNpdG9yX2lkIjoiMTkxODE5MDkyODAwMzEyOTE0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacdb0c0f330890fbbad5844202c86ecc1549ae419bd2759d076bd67379955d0902
hovercard-subject-tagissue:1718145253
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TypeScriptToLua/TypeScriptToLua/1445/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5b0d67e16c392cf70a4ecefac6fa62908d9592451ded70081f32515e6556be6c/TypeScriptToLua/TypeScriptToLua/issues/1445
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5b0d67e16c392cf70a4ecefac6fa62908d9592451ded70081f32515e6556be6c/TypeScriptToLua/TypeScriptToLua/issues/1445
og:image:altAbstract tstl fails to produce valid lua code from a subset of valid (accordingly to tstl docs) code if ts file names contain dots in paths. This problem may naturally arise, for example, when comp...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRenegatto
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/TypeScriptToLua/TypeScriptToLua git https://github.com/TypeScriptToLua/TypeScriptToLua.git
octolytics-dimension-user_id44121206
octolytics-dimension-user_loginTypeScriptToLua
octolytics-dimension-repository_id115876595
octolytics-dimension-repository_nwoTypeScriptToLua/TypeScriptToLua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id115876595
octolytics-dimension-repository_network_root_nwoTypeScriptToLua/TypeScriptToLua
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTypeScriptToLua%2FTypeScriptToLua%2Fissues%2F1445
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTypeScriptToLua%2FTypeScriptToLua%2Fissues%2F1445
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=TypeScriptToLua%2FTypeScriptToLua
Reloadhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
Reloadhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
Reloadhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
TypeScriptToLuahttps://github.com/TypeScriptToLua
TypeScriptToLuahttps://github.com/TypeScriptToLua/TypeScriptToLua
Codehttps://github.com/TypeScriptToLua/TypeScriptToLua
Issues132 (132)https://github.com/TypeScriptToLua/TypeScriptToLua/issues
Pull requests13 (13)https://github.com/TypeScriptToLua/TypeScriptToLua/pulls
Actionshttps://github.com/TypeScriptToLua/TypeScriptToLua/actions
Wikihttps://github.com/TypeScriptToLua/TypeScriptToLua/wiki
Security and qualityhttps://github.com/TypeScriptToLua/TypeScriptToLua/security
Insightshttps://github.com/TypeScriptToLua/TypeScriptToLua/insights
https://github.com/TypeScriptToLua/TypeScriptToLua
New issuehttps://github.com/login?return_to=https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
New issuehttps://github.com/login?return_to=https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
#1702https://github.com/TypeScriptToLua/TypeScriptToLua/pull/1702
Dots in module path breaks Lua import in a non-bundle compilationhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#top
#1702https://github.com/TypeScriptToLua/TypeScriptToLua/pull/1702
bughttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22bug%22
scope: transpileAny transpilation not directly related to code transformshttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22scope%3A%20transpile%22
https://github.com/Renegatto
Renegattohttps://github.com/Renegatto
on May 20, 2023https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#issue-1718145253
Perryvwhttps://github.com/Perryvw
bughttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22bug%22
scope: transpileAny transpilation not directly related to code transformshttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22scope%3A%20transpile%22
on May 22, 2023https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#event-9306070088
https://github.com/Perryvw
Perryvwhttps://github.com/Perryvw
on May 22, 2023https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#issuecomment-1557722604
https://github.com/SamuelRobertBond
SamuelRobertBondhttps://github.com/SamuelRobertBond
on Jun 6, 2023https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#issuecomment-1577807047
#1455https://github.com/TypeScriptToLua/TypeScriptToLua/pull/1455
https://github.com/denis-atsuta
denis-atsutahttps://github.com/denis-atsuta
on Mar 25, 2026https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#issuecomment-4122420038
RealColdFryhttps://github.com/RealColdFry
on Mar 30, 2026https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#event-24036187355
fix dots in file/directory names breaking Lua require resolution (Typ…https://github.com/RealColdFry/TypeScriptToLua/commit/b85b5dee94a3b5a84ff7da4b9d576b98c9a849ae
Typ…https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
b85b5dehttps://github.com/RealColdFry/TypeScriptToLua/commit/b85b5dee94a3b5a84ff7da4b9d576b98c9a849ae
Perryvwhttps://github.com/Perryvw
on Apr 16, 2026https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#event-24582358366
fix dots in file/directory names breaking Lua require resolution (#1445…https://github.com/TypeScriptToLua/TypeScriptToLua/commit/2fc2e99680aada83ac3524166197760696ec08d2
#1445https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
2fc2e99https://github.com/TypeScriptToLua/TypeScriptToLua/commit/2fc2e99680aada83ac3524166197760696ec08d2
Perryvwhttps://github.com/Perryvw
completedhttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#1702https://github.com/TypeScriptToLua/TypeScriptToLua/pull/1702
on Apr 16, 2026https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445#event-24582358639
Sign up for freehttps://github.com/signup?return_to=https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
Sign in to commenthttps://github.com/login?return_to=https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1445
bughttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22bug%22
scope: transpileAny transpilation not directly related to code transformshttps://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=state%3Aopen%20label%3A%22scope%3A%20transpile%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.