Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error: Maximum call stack size exceeded #25149

Closed
LeviticusMB opened this issue Jun 22, 2018 · 2 comments · Fixed by #25228
Closed

Compiler error: Maximum call stack size exceeded #25149

LeviticusMB opened this issue Jun 22, 2018 · 2 comments · Fixed by #25228
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@LeviticusMB
Copy link

I'm using browserify with tsc as a transpiler to bundle up some NPM libs for a browser project. Works for most modules I've tried, but when adding yjs to the bundle, the compiler crashes.

TypeScript Version: 3.0.0-dev.20180622

Search Terms: RangeError

Code

#!/bin/bash

set -ex

#MODULES="libphonenumber-js yjs"
MODULES="yjs"

mkdir tsc-error
cd tsc-error
npm init --yes
npm add typescript@next browserify@16.2.2 yjs@12.3.3 libphonenumber-js@1.2.14

for module in ${MODULES}; do
    (echo -n 'export default ' && npx browserify node_modules/${module}) > ${module}.js
done

npx -s bash tsc --version
npx -s bash tsc --allowJs --outFile bundle.js --module amd *.js

Expected behavior:

No crash.

Actual behavior:

RangeError: Maximum call stack size exceeded
    at getResolvedSymbol (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:34092:35)
    at checkIdentifier (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:35273:26)
    at checkExpressionWorker (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:39935:28)
    at checkExpression (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:39911:42)
    at checkNonNullExpression (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:37221:37)
    at checkPropertyAccessExpressionOrQualifiedName (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:37247:28)
    at checkPropertyAccessExpression (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:37240:20)
    at checkExpressionWorker (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:39961:28)
    at checkExpression (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:39911:42)
    at checkBinaryLikeExpression (/Users/mb/Desktop/tsc-error/node_modules/typescript/lib/tsc.js:39503:28)

Related Issues: #17033

@mhegazy mhegazy added this to the TypeScript 3.0 milestone Jun 25, 2018
@mhegazy mhegazy added the Bug A bug in TypeScript label Jun 25, 2018
@sandersn
Copy link
Member

sandersn commented Jun 25, 2018

Here's a small repro

function* f() {
    var o
    while (true) {
        o = yield o // also fails with yield*
    }
}

@sandersn
Copy link
Member

Note: Fails in Typescript too, as long as noImplicitAny is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants