Title: TS 2.9.2 incorrectly imports symbol from file rather than from library · Issue #25026 · microsoft/TypeScript · GitHub
Open Graph Title: TS 2.9.2 incorrectly imports symbol from file rather than from library · Issue #25026 · microsoft/TypeScript
X Title: TS 2.9.2 incorrectly imports symbol from file rather than from library · Issue #25026 · microsoft/TypeScript
Description: 2.9.2 have broken my build process. After an investigation I found strange thing. There is a code which worked in previous version: import { createToken, Lexer, IToken } from 'chevrotain'; export const WhiteSpace = createToken({ name: 'W...
Open Graph Description: 2.9.2 have broken my build process. After an investigation I found strange thing. There is a code which worked in previous version: import { createToken, Lexer, IToken } from 'chevrotain'; export c...
X Description: 2.9.2 have broken my build process. After an investigation I found strange thing. There is a code which worked in previous version: import { createToken, Lexer, IToken } from 'chevrotain'; ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/25026
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS 2.9.2 incorrectly imports symbol from file rather than from library","articleBody":"2.9.2 have broken my build process. After an investigation I found strange thing. There is a code which worked in previous version:\r\n\r\n```\r\nimport { createToken, Lexer, IToken } from 'chevrotain';\r\n\r\nexport const WhiteSpace = createToken({\r\n name: 'WhiteSpace',\r\n pattern: /[ \\t]+/,\r\n line_breaks: false\r\n});\r\n...\r\n```\r\nNow it produces incorrect type definition:\r\n\r\n```\r\nimport { Lexer, IToken } from 'chevrotain';\r\nexport declare const WhiteSpace: import(\"../../../../../../Golden/NS/lib/gdmn-nlp/node_modules/chevrotain\").TokenType;\r\n```\r\n\r\nWhen I specify type of constant directly all works well:\r\n\r\n```\r\nimport { createToken, Lexer, IToken, TokenType } from 'chevrotain';\r\n\r\nexport const WhiteSpace: TokenType = createToken({\r\n name: 'WhiteSpace',\r\n pattern: /[ \\t]+/,\r\n line_breaks: false\r\n});\r\n```\r\n\r\nresults into correct type definition:\r\n\r\n```\r\nimport { Lexer, IToken, TokenType } from 'chevrotain';\r\nexport declare const WhiteSpace: TokenType;\r\n```\r\n\r\nThe function CreateToken declared as:\r\n\r\n`export declare function createToken(config: ITokenConfig): TokenType\r\n`\r\n\r\nSo, in the example above TS **must** know about type of constant and use type TokenType from library **chevrotain** instead of disk file.\r\n","author":{"url":"https://github.com/gsbelarus","@type":"Person","name":"gsbelarus"},"datePublished":"2018-06-17T08:14:18Z","url":"https://github.com/microsoft/TypeScript/issues/25026"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7e80bf96-f8e7-53dd-3a4b-5e27ffb82dcb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E858:1760D:147AAAC:1AB4389:6B050449 |
| html-safe-nonce | 60979e5ac77eaffca0b580214037a82e969f29ecda436a8798234200ca14a6cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODU4OjE3NjBEOjE0N0FBQUM6MUFCNDM4OTo2QjA1MDQ0OSIsInZpc2l0b3JfaWQiOiI3NjU2NTU3NDI0OTI0NzU1MDE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 418feda32bab3127015eabe65870083f9aaad8caa7ffc72c78a783db1f194e0b |
| hovercard-subject-tag | issue:333044995 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/25026/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2126e4c7eddaf05be9d734bf748c907057409c899aa74561af6001a4c0e96c90/microsoft/TypeScript/issues/25026 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2126e4c7eddaf05be9d734bf748c907057409c899aa74561af6001a4c0e96c90/microsoft/TypeScript/issues/25026 |
| og:image:alt | 2.9.2 have broken my build process. After an investigation I found strange thing. There is a code which worked in previous version: import { createToken, Lexer, IToken } from 'chevrotain'; export c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gsbelarus |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width