René's URL Explorer Experiment


Title: The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary. · Issue #42873 · microsoft/TypeScript · GitHub

Open Graph Title: The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary. · Issue #42873 · microsoft/TypeScript

X Title: The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary. · Issue #42873 · microsoft/TypeScript

Description: Bug Report 🔎 Search Terms inferred type cannot be named, symlink node_modules 🕗 Version & Regression Information I'm verifying the problem on the typescript@4.1.3. I've not tried older versions but at least is also reproducible on the @n...

Open Graph Description: Bug Report 🔎 Search Terms inferred type cannot be named, symlink node_modules 🕗 Version & Regression Information I'm verifying the problem on the typescript@4.1.3. I've not tried older versions but...

X Description: Bug Report 🔎 Search Terms inferred type cannot be named, symlink node_modules 🕗 Version & Regression Information I'm verifying the problem on the typescript@4.1.3. I've not tried older ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The inferred type of \"X\" cannot be named without a reference to \"Y\". This is likely not portable. A type annotation is necessary.","articleBody":"# Bug Report\r\n\r\n\u003c!--\r\n  Please fill in each section completely. Thank you!\r\n--\u003e\r\n\r\n### 🔎 Search Terms\r\n\r\n\u003c!--\r\n  What search terms did you use when trying to find an existing bug report?\r\n  List them here so people in the future can find this one more easily.\r\n--\u003e\r\n\r\ninferred type cannot be named, symlink node_modules\r\n\r\n### 🕗 Version \u0026 Regression Information\r\n\r\n\u003c!-- When did you start seeing this bug occur?\r\n\r\n\"Bugs\" that have existed in TS for a long time are very likely to be FAQs; refer to\r\n  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs\r\n\r\nIf possible, please try testing the nightly version of TS to see if it's already been fixed.\r\nFor npm: `typescript@next`\r\nThis is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly\r\n\r\nNote: The TypeScript Playground can be used to try older versions of TypeScript.\r\n\r\nPlease keep and fill in the line that best applies:\r\n--\u003e\r\nI'm verifying the problem on the `typescript@4.1.3`. I've not tried older versions but at least is also reproducible on the `@next` version as of today.\r\n\r\nIt is probably a regression or a corner case related with other issues opened and already closed like:\r\n\r\n- https://github.com/microsoft/TypeScript/issues/30858\r\n- https://github.com/microsoft/TypeScript/issues/28689\r\n- https://github.com/microsoft/TypeScript/issues/2338\r\n- https://github.com/microsoft/TypeScript/issues/29221\r\n\r\n### ⏯ Playground Link\r\n\r\n\u003c!--\r\n  A link to a TypeScript Playground \"Share\" link which shows this behavior\r\n\r\n  The TypeScript Workbench can be used for more complex setups, try\r\n  https://www.typescriptlang.org/dev/bug-workbench/\r\n\r\n  As a last resort, you can link to a repo, but these will be slower for us to investigate.\r\n--\u003e\r\n[Link for a repo where the problem is being reproduced](https://github.com/mistic/reproduce-typescript-problem-when-symlinking-node_modules)\r\n\r\n\u003e NOTE: Just clone the repo and run `yarn tsc`\r\n\r\n### 💻 Code\r\n\r\n\u003c!-- Please post the relevant code sample here as well--\u003e\r\n\r\nAll the relevant code can be found at https://github.com/mistic/reproduce-typescript-problem-when-symlinking-node_modules\r\n\r\nIt is just reproducing a similar setup that I had on other project that was generating the problem:\r\n\r\n- node_modules are a symlink to another location that is not a direct parent of the symlinked node_modules\r\n- we are using types in the compilation from a library where those types are just exported from other one, like for example `withRouter` within `react-router-dom` that is just a plain export from the same type on `react-router`.\r\n\r\n### 🙁 Actual behavior\r\n\r\nI got the following error:\r\n\r\n```\r\nerror TS2742: The inferred type of 'Nav' cannot be named without a reference to '../../deps/node_modules/@types/react-router'. This is likely not portable. A type annotation is necessary.\r\n\r\n8 export const Nav = withRouter(({ history }: NavProps) =\u003e {\r\n               ~~~\r\n\r\n\r\nFound 1 error.\r\n```\r\n### 🙂 Expected behavior\r\n\r\n\u003c!-- What you expected to happen instead, and why --\u003e\r\n\r\nI was expecting no error at all and that the typescript compiler was just able to find all the respective modules. I've tried everything that I thought was related like enabled the `preserveSymlinks`. The only thing that stops the error is importing the `withRouter` type directly from `react-router` and not from `react-router-dom` but that doesn't make very sense because I actually want to use the `react-router-dom` on a couple of places.\r\n\r\n\\cc @weswigham @sheetalkamat @andrewbranch because I saw you previously worked to try to solve similar issues. \r\n","author":{"url":"https://github.com/mistic","@type":"Person","name":"mistic"},"datePublished":"2021-02-19T00:03:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":136},"url":"https://github.com/42873/TypeScript/issues/42873"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6f812e47-d185-327b-3ae6-9ce61bce9131
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8B9A:324D9E:1001A6F:16F5564:6A5F9121
html-safe-nonce862792c5a13bdae4b61cb93a16554e30d581a7282ecaca10a66da876f3f395ac
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjlBOjMyNEQ5RToxMDAxQTZGOjE2RjU1NjQ6NkE1RjkxMjEiLCJ2aXNpdG9yX2lkIjoiMzU5NzQzMTAyNjU2NDk2MDU0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbfd8643cc2c8d68f5f4dd46e9026f354bb8e00c29f32390d202cae1be913cbd6
hovercard-subject-tagissue:811568342
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/42873/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b74d058b2802aac2c9fc6912354d23b2530257b72b9624d894d66dabdac3c2f3/microsoft/TypeScript/issues/42873
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b74d058b2802aac2c9fc6912354d23b2530257b72b9624d894d66dabdac3c2f3/microsoft/TypeScript/issues/42873
og:image:altBug Report 🔎 Search Terms inferred type cannot be named, symlink node_modules 🕗 Version & Regression Information I'm verifying the problem on the typescript@4.1.3. I've not tried older versions but...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemistic
hostnamegithub.com
expected-hostnamegithub.com
None419b66b5f218029570caa18c30987e7dbabe4f5a6767918b33a504d02739c9c7
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
releasede5b18aa36dbc0b61e03aeb111e84e90fde499b8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/42873#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F42873
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F42873
Sign up https://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/42873
Reloadhttps://github.com/microsoft/TypeScript/issues/42873
Reloadhttps://github.com/microsoft/TypeScript/issues/42873
Please reload this pagehttps://github.com/microsoft/TypeScript/issues/42873
microsoft https://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Notifications https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript
Fork 13.6k https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript
Star 110k https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript
Code https://github.com/microsoft/TypeScript
Issues 5k+ https://github.com/microsoft/TypeScript/issues
Pull requests 29 https://github.com/microsoft/TypeScript/pulls
Actions https://github.com/microsoft/TypeScript/actions
Projects https://github.com/microsoft/TypeScript/projects
Models https://github.com/microsoft/TypeScript/models
Wiki https://github.com/microsoft/TypeScript/wiki
Security and quality 0 https://github.com/microsoft/TypeScript/security
Insights https://github.com/microsoft/TypeScript/pulse
Code https://github.com/microsoft/TypeScript
Issues https://github.com/microsoft/TypeScript/issues
Pull requests https://github.com/microsoft/TypeScript/pulls
Actions https://github.com/microsoft/TypeScript/actions
Projects https://github.com/microsoft/TypeScript/projects
Models https://github.com/microsoft/TypeScript/models
Wiki https://github.com/microsoft/TypeScript/wiki
Security and quality https://github.com/microsoft/TypeScript/security
Insights https://github.com/microsoft/TypeScript/pulse
The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.https://github.com/microsoft/TypeScript/issues/42873#top
https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
RescheduledThis issue was previously scheduled to an earlier milestonehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Rescheduled%22
TypeScript 5.5.0https://github.com/microsoft/TypeScript/milestone/179
https://github.com/mistic
mistichttps://github.com/mistic
on Feb 19, 2021https://github.com/microsoft/TypeScript/issues/42873#issue-811568342
types in transitive dependencies causing errors after upgrade from 3.1: The inferred type of ... cannot be named without a reference to #30858https://github.com/microsoft/TypeScript/issues/30858
Rush's node_modules structure is not resolved in vscode correctly #28689https://github.com/microsoft/TypeScript/issues/28689
External module resolution logic #2338https://github.com/microsoft/TypeScript/issues/2338
importHelpers with symlinks breaks type resolution #29221https://github.com/microsoft/TypeScript/issues/29221
Link for a repo where the problem is being reproducedhttps://github.com/mistic/reproduce-typescript-problem-when-symlinking-node_modules
https://github.com/mistic/reproduce-typescript-problem-when-symlinking-node_moduleshttps://github.com/mistic/reproduce-typescript-problem-when-symlinking-node_modules
@weswighamhttps://github.com/weswigham
@sheetalkamathttps://github.com/sheetalkamat
@andrewbranchhttps://github.com/andrewbranch
weswighamhttps://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
RescheduledThis issue was previously scheduled to an earlier milestonehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Rescheduled%22
TypeScript 5.5.0https://github.com/microsoft/TypeScript/milestone/179
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.