René's URL Explorer Experiment


Title: TypeScript generates invalid `import` for re-exported types · Issue #26985 · microsoft/TypeScript · GitHub

Open Graph Title: TypeScript generates invalid `import` for re-exported types · Issue #26985 · microsoft/TypeScript

X Title: TypeScript generates invalid `import` for re-exported types · Issue #26985 · microsoft/TypeScript

Description: The issue was reported on #24941 (comment). It was initially discovered in loopbackio/loopback-next#1643. In this case, MetadataAccessor is exported from @loopback/metadata and re-exported by @loopback/context. Please note that @loopback...

Open Graph Description: The issue was reported on #24941 (comment). It was initially discovered in loopbackio/loopback-next#1643. In this case, MetadataAccessor is exported from @loopback/metadata and re-exported by @loop...

X Description: The issue was reported on #24941 (comment). It was initially discovered in loopbackio/loopback-next#1643. In this case, MetadataAccessor is exported from @loopback/metadata and re-exported by @loop...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/26985

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeScript generates invalid `import` for re-exported types","articleBody":"The issue was reported on https://github.com/Microsoft/TypeScript/pull/24941#issuecomment-415900977. It was initially discovered in strongloop/loopback-next#1643.\r\n\r\nIn this case, MetadataAccessor is exported from @loopback/metadata and re-exported by @loopback/context. Please note that @loopback/repository-json-schema module imports MetadataAccessor from @loopback/context. It leads to incorrectly generated code.\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:**  3.0.x and up\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** TypeScript import types\r\n\r\n**Code**\r\n\r\nhttps://github.com/strongloop/loopback-next/blob/5b27323ba420bfc500fdf9f2762e7292b96ffa0f/packages/repository-json-schema/src/keys.ts\r\n\r\n```ts\r\n// A *self-contained* demonstration of the problem follows...\r\n// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nTypeScript generates the following code:\r\n```ts\r\nimport { MetadataAccessor } from '@loopback/context';\r\nimport { JSONSchema6 as JSONSchema } from 'json-schema';\r\n/**\r\n * Metadata key used to set or retrieve repository JSON Schema\r\n */\r\nexport declare const JSON_SCHEMA_KEY: MetadataAccessor\u003cJSONSchema, import(\"@loopback/context\").DecoratorType>;\r\n```\r\n**Actual behavior:**\r\n\r\nTypeScript generates invalid code as follows:\r\n```ts\r\nimport { MetadataAccessor } from '@loopback/context';\r\nimport { JSONSchema6 as JSONSchema } from 'json-schema';\r\n/**\r\n * Metadata key used to set or retrieve repository JSON Schema\r\n */\r\nexport declare const JSON_SCHEMA_KEY: MetadataAccessor\u003cJSONSchema, import(\"../context/node_modules/@loopback/metadata/src/types\").DecoratorType>;\r\n```\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior -->\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\nhttps://github.com/Microsoft/TypeScript/pull/24874\r\n","author":{"url":"https://github.com/raymondfeng","@type":"Person","name":"raymondfeng"},"datePublished":"2018-09-09T04:08:32Z","url":"https://github.com/microsoft/TypeScript/issues/26985"}

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:1c605b99-91bc-bf15-2e9d-38d43b3fab3b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBA36:1FE434:E752A4:1317832:6B01D261
html-safe-nonceecfbb1136fe05d5c5c779e31c010e174068ea372011e26bc1cdd64046eb9364f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTM2OjFGRTQzNDpFNzUyQTQ6MTMxNzgzMjo2QjAxRDI2MSIsInZpc2l0b3JfaWQiOiI3NjcwMDMyNzY0NTU2NjYxMzQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4d8e53dbfb52ba8782525cea5089495ba9e1bbf478267b609615d6b64f39bacd
hovercard-subject-tagissue:358347937
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/microsoft/TypeScript/26985/issue_layout
twitter:imagehttps://opengraph.githubassets.com/32a601f98156fb0b8621ecfcc842956acce2e544f2ce206d0a53aaa2a7490f5d/microsoft/TypeScript/issues/26985
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/32a601f98156fb0b8621ecfcc842956acce2e544f2ce206d0a53aaa2a7490f5d/microsoft/TypeScript/issues/26985
og:image:altThe issue was reported on #24941 (comment). It was initially discovered in loopbackio/loopback-next#1643. In this case, MetadataAccessor is exported from @loopback/metadata and re-exported by @loop...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameraymondfeng
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/26985#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F26985
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%2Fmicrosoft%2FTypeScript%2Fissues%2F26985
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=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/26985
Reloadhttps://github.com/microsoft/TypeScript/issues/26985
Reloadhttps://github.com/microsoft/TypeScript/issues/26985
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26985
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26985
#27340https://github.com/microsoft/TypeScript/pull/27340
TypeScript generates invalid import for re-exported typeshttps://github.com/microsoft/TypeScript/issues/26985#top
#27340https://github.com/microsoft/TypeScript/pull/27340
https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
https://github.com/raymondfeng
Raymond Feng (raymondfeng)https://github.com/raymondfeng
on Sep 9, 2018https://github.com/microsoft/TypeScript/issues/26985#issue-358347937
#24941 (comment)https://github.com/microsoft/TypeScript/pull/24941#issuecomment-415900977
loopbackio/loopback-next#1643https://github.com/loopbackio/loopback-next/issues/1643
https://github.com/strongloop/loopback-next/blob/5b27323ba420bfc500fdf9f2762e7292b96ffa0f/packages/repository-json-schema/src/keys.tshttps://github.com/strongloop/loopback-next/blob/5b27323ba420bfc500fdf9f2762e7292b96ffa0f/packages/repository-json-schema/src/keys.ts
#24874https://github.com/microsoft/TypeScript/pull/24874
Raymond Feng (raymondfeng)https://github.com/raymondfeng
on Sep 9, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1834442678
fix(rest): use direct import to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/dfab96d9fe6816ef8be058a85a84468163751de6
dfab96dhttps://github.com/loopbackio/loopback-next/commit/dfab96d9fe6816ef8be058a85a84468163751de6
https://github.com/raymondfeng
Raymond Feng (raymondfeng)https://github.com/raymondfeng
on Sep 9, 2018https://github.com/microsoft/TypeScript/issues/26985#issuecomment-419732014
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/raymondfeng/ts-26985https://github.com/raymondfeng/ts-26985
Raymond Feng (raymondfeng)https://github.com/raymondfeng
on Sep 10, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1836165455
fix(rest): use direct import to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/a77970c864d1d08d7892b1921d37fc5798817cd6
a77970chttps://github.com/loopbackio/loopback-next/commit/a77970c864d1d08d7892b1921d37fc5798817cd6
fix(rest): use direct import to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/95cf97660492dd67f2ab6feafd0be1d9d2d3c2df
95cf976https://github.com/loopbackio/loopback-next/commit/95cf97660492dd67f2ab6feafd0be1d9d2d3c2df
fix(rest): use direct import to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/2cf3b2c7e5a8256ffc7ef174ee0cc47ccb82153f
2cf3b2chttps://github.com/loopbackio/loopback-next/commit/2cf3b2c7e5a8256ffc7ef174ee0cc47ccb82153f
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 17, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1850774044
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Wesley Wigham (weswigham)https://github.com/weswigham
on Sep 17, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1850774220
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
on Sep 17, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1850774312
Raymond Feng (raymondfeng)https://github.com/raymondfeng
on Sep 28, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1874228031
fix(metadata): remove the default type to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/1eb97bfc8d525d692dd523d1270c3326165069ef
1eb97bfhttps://github.com/loopbackio/loopback-next/commit/1eb97bfc8d525d692dd523d1270c3326165069ef
fix(metadata): remove the default type to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/618e35de47b36c433b01da32f5cc54f809cd51fc
618e35dhttps://github.com/loopbackio/loopback-next/commit/618e35de47b36c433b01da32f5cc54f809cd51fc
fix(metadata): remove the default type to work around a TS bughttps://github.com/loopbackio/loopback-next/commit/fc89a2c2e01d3642a557c8fca4cd0068d35f8980
fc89a2chttps://github.com/loopbackio/loopback-next/commit/fc89a2c2e01d3642a557c8fca4cd0068d35f8980
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
on Nov 13, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1964088883
Wesley Wigham (weswigham)https://github.com/weswigham
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#27340https://github.com/microsoft/TypeScript/pull/27340
on Nov 13, 2018https://github.com/microsoft/TypeScript/issues/26985#event-1964369543
https://github.com/mbrowne
Matt Browne (mbrowne)https://github.com/mbrowne
on Nov 19, 2018https://github.com/microsoft/TypeScript/issues/26985#issuecomment-440023809
#27340https://github.com/microsoft/TypeScript/pull/27340
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Nov 19, 2018https://github.com/microsoft/TypeScript/issues/26985#issuecomment-440025884
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/26985#event-20415792131
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/26985
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26985
Wesley Wigham (weswigham)https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
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.