{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/18270","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/18270/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/18270/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/18270/events","html_url":"https://github.com/Microsoft/TypeScript/issues/18270","id":255537793,"number":18270,"title":"RangeError: Maximum call stack size exceeded on simple, but has deep module dependency","user":{"login":"Develofrog","id":23724355,"avatar_url":"https://avatars1.githubusercontent.com/u/23724355?v=4","gravatar_id":"","url":"https://api.github.com/users/Develofrog","html_url":"https://github.com/Develofrog","followers_url":"https://api.github.com/users/Develofrog/followers","following_url":"https://api.github.com/users/Develofrog/following{/other_user}","gists_url":"https://api.github.com/users/Develofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/Develofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Develofrog/subscriptions","organizations_url":"https://api.github.com/users/Develofrog/orgs","repos_url":"https://api.github.com/users/Develofrog/repos","events_url":"https://api.github.com/users/Develofrog/events{/privacy}","received_events_url":"https://api.github.com/users/Develofrog/received_events","type":"User","site_admin":false},"labels":[{"id":113971601,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/External","name":"External","color":"eb6420","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-09-06T09:26:29Z","updated_at":"2017-09-21T22:42:56Z","closed_at":"2017-09-21T22:42:56Z","author_association":"NONE","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  2.5.2\r\n\r\n**Code**\r\n\r\n```ts\r\n// client.ts, server.ts\r\nimport data from './module0'\r\nconsole.log(data)\r\n\r\n// (x) means variable x\r\n// module(x).ts\r\nimport data from './module(x+1)'\r\nexport default data\r\n\r\n// module718.ts\r\nconst data = 100\r\nexport default data\r\n\r\n// webpack.config.js\r\nvar path = require('path')\r\n\r\nvar CleanWebpackPlugin = require('clean-webpack-plugin')\r\n\r\nmodule.exports = {\r\n  entry: {\r\n    client: path.join(__dirname, '1-original/client.ts'),\r\n    server: path.join(__dirname, '1-original/server.ts'),\r\n  },\r\n\r\n  output: {\r\n    filename: '1.ts.[name].[hash].js',\r\n    path: path.join(__dirname, 'dist')\r\n  },\r\n\r\n  resolve: {\r\n    extensions: ['.ts'],\r\n    modules: [\r\n      'node_modules',\r\n    ],\r\n  },\r\n\r\n  devtool: 'eval',\r\n  target: 'web',\r\n\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.ts$/,\r\n        loader: 'awesome-typescript-loader',\r\n        include: [\r\n          path.join(__dirname, '1-original')\r\n        ],\r\n        query: {\r\n          configFileName: path.join(__dirname, 'tsconfig.1.json')\r\n        }\r\n      }\r\n    ]\r\n  },\r\n\r\n  plugins: [\r\n    new CleanWebpackPlugin([\r\n      path.join(__dirname, 'dist')\r\n    ])\r\n  ]\r\n}\r\n\r\n// \r\n```\r\n\r\n**Expected behavior:**\r\nCompiled well.\r\n\r\n**Actual behavior:**\r\nHello, I created this project for benchmarking performance of TypeScript. (and Babel.)\r\nI made module dependence tree like below with Webpack.\r\n\r\n![test-ts](https://user-images.githubusercontent.com/23724355/30104045-72b58236-932f-11e7-83c3-7f2ac2e81b76.jpg)\r\n\r\nBut, Webpack said..\r\n\r\n```text\r\n[at-loader]: Child process failed to process the request:  RangeError: Maximum call stack size exceeded\r\n    at String.lastIndexOf (native)\r\n    at Object.startsWith (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:3024:20)\r\n    at resolveExternalModule (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24128:20)\r\n    at resolveExternalModuleNameWorker (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24121:20)\r\n    at resolveExternalModuleName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24113:20)\r\n    at getTargetOfImportClause (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23820:32)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23947:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at getSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23255:38)\r\n    at resolveNameHelper (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23396:34)\r\n    at resolveName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23383:20)\r\n    at resolveEntityName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24060:26)\r\n    at getTargetOfExportAssignment (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23940:20)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23955:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at resolveSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23969:36)\r\n    at getTargetOfImportClause (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23830:27)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23947:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at getSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23255:38)\r\n    at resolveNameHelper (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23396:34)\r\n    at resolveName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23383:20)\r\n    at resolveEntityName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24060:26)\r\n    at getTargetOfExportAssignment (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23940:20)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23955:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at resolveSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23969:36)\r\n    at getTargetOfImportClause (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23830:27)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23947:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n```\r\n\r\nFirst, I think It is occured by `awesome-typescript-loader`, so I changed my loader to `ts-loader`.\r\nBut Result is..\r\n\r\n```text\r\nModule build failed: RangeError: Maximum call stack size exceeded\r\n    at Object.assert (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:3509:24)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23972:22)\r\n    at getSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23255:38)\r\n    at resolveNameHelper (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23396:34)\r\n    at resolveName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23383:20)\r\n    at resolveEntityName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24060:26)\r\n    at getTargetOfExportAssignment (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23940:20)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23955:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at resolveSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23969:36)\r\n    at getTargetOfImportClause (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23830:27)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23947:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at getSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23255:38)\r\n    at resolveNameHelper (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23396:34)\r\n    at resolveName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23383:20)\r\n    at resolveEntityName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24060:26)\r\n    at getTargetOfExportAssignment (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23940:20)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23955:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at resolveSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23969:36)\r\n    at getTargetOfImportClause (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23830:27)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23947:28)\r\n    at resolveAlias (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23978:30)\r\n    at getSymbol (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23255:38)\r\n    at resolveNameHelper (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23396:34)\r\n    at resolveName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23383:20)\r\n    at resolveEntityName (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:24060:26)\r\n    at getTargetOfExportAssignment (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23940:20)\r\n    at getTargetOfAliasDeclaration (/Users/lawlight/Development/ts-vs-babel/node_modules/typescript/lib/typescript.js:23955:28)\r\n```\r\n\r\nAnd, In Babel case, All is perfect.(using same module dependence tree for transpiling)\r\nTherefore, It is maybe not occured by `Webpack`. So I guess cause of this problem is `TypeScript`.\r\n\r\nWhen I used `tsc`, It looks like working well, but I can't create **multiple entry(server.ts, client.ts)** with `tsc` with 1 file although I use `--outFile`.\r\n\r\nWhat should I do?"}}
{"actor":{"display_login":"mhegazy"}}