You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assertion violation: undefined relativeSpecifiers on Object.getModuleSpecifiers #42785
dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:91576
ts.Debug.checkDefined(relativeSpecifiers);
^
Error: Debug Failure.
at Object.getModuleSpecifiers (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:91576:30)
at getSpecifierForModuleSymbol (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39998:62)
at dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39874:39
at Array.map (<anonymous>)
at getSymbolChain (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39872:58)
at lookupSymbolChainWorker (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39858:51)
at lookupSymbolChain (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39852:24)
at symbolToTypeNode (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:40005:29)
at typeToTypeNodeHelper (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39150:28)
at mapToTypeNodes (dependencies_path\typescript@4.2.1-rc\node_modules\typescript\lib\tsc.js:39671:40)
/patheu/typescript/lib/tsc.js:91587
ts.Debug.checkDefined(relativeSpecifiers);
^
Error: Debug Failure.
at Object.getModuleSpecifiers (/path/node_modules/typescript/lib/tsc.js:91587:30)
at getSpecifierForModuleSymbol (/path/node_modules/typescript/lib/tsc.js:39998:62)
at /path/node_modules/typescript/lib/tsc.js:39874:39
at Array.map (<anonymous>)
at getSymbolChain (/path/node_modules/typescript/lib/tsc.js:39872:58)
at lookupSymbolChainWorker (/path/node_modules/typescript/lib/tsc.js:39858:51)
at lookupSymbolChain (/path/node_modules/typescript/lib/tsc.js:39852:24)
at symbolToTypeNode (/path/node_modules/typescript/lib/tsc.js:40005:29)
at typeReferenceToTypeNode (/path/node_modules/typescript/lib/tsc.js:39463:40)
at typeToTypeNodeHelper (/path/node_modules/typescript/lib/tsc.js:39155:95)
This seems to be related to type inference; as the solution to this crash is to explicitly declare the type of a const though I'm not able to reproduce the exact cause.
This seems to be related to type inference; as the solution to this crash is to explicitly declare the type of a const though I'm not able to reproduce the exact cause.
For my projects that were reproducing this I tracked it back to a regression introduced by #42095 .
I was able to get my projects building without the crash by reverting a single line in the PR that was doing extra filtering on the return of forEachFileNameOfModule in src/compiler/moduleSpecifiers.ts.
I am not sure if this is a complete fix and how it might interact with the desired behavior introduced by #42095.
Brandon Bayer (@flybayer) I can’t reproduce with your repo. I get a few checker errors but no crash:
❯ yarn tsc
yarn run v1.22.4
$ /System/Volumes/Data/Developer/microsoft/eg/tsc-broken/node_modules/.bin/tsc
app/auth/mutations/forgotPassword.test.ts:12:3 - error TS2698: Spread types may only be created from object types.
12 ...jest.requireActual("blitz")!,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
db/index.ts:2:10 - error TS2305: Module '"@prisma/client"' has no exported member 'PrismaClient'.
2 import { PrismaClient } from "@prisma/client"
~~~~~~~~~~~~
types.ts:3:10 - error TS2614: Module '"db"' has no exported member 'User'. Did you mean to use 'import User from "db"' instead?
3 import { User } from "db"
~~~~
Found 3 errors.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
David Lannoye (@dlannoye) (or actually anyone else who has seen this error), are you using pnpm or some other system that puts modules in a hidden folder (starting with .) inside node_modules? The line you reverted to fix your problem is supposed to filter out invalid module specifiers, and the crash means you were left with no valid module specifiers after the filtering. But if you’re not using pnpm, I’m very confused as to what was getting filtered out in the first place. If anyone can provide a small reproduction of this bug, that would be very helpful.
Andrew Branch (@andrewbranch) run yarn blitz prisma generate to fix those type errors, and then tsc should crash. That prisma command is supposed to run automatically. It generates code and typedefs at node_modules/.prisma.
Ah, yep, the .prisma is the culprit there. Are you supposed to be able to import from ".prisma"? We assume that anything in a dotted folder in node_modules is a temporary path and should be ignored.
Activity
btakita commentedon Feb 23, 2021
I'm getting a similar error:
btakita commentedon Feb 24, 2021
This seems to be related to type inference; as the solution to this crash is to explicitly declare the type of a
constthough I'm not able to reproduce the exact cause.07akioni commentedon Feb 24, 2021
I'm facing the same problem (only in ts 4.2):
flybayer commentedon Feb 27, 2021
I'm having the same error, and I have a small reproduction repo: https://github.com/flybayer/tsc-broken (boilerplate for a new Blitz app)
git clone git@github.com:flybayer/tsc-broken.gitcd tsc-brokenyarnyarn tscRelated: #42773
dlannoye commentedon Feb 27, 2021
For my projects that were reproducing this I tracked it back to a regression introduced by #42095 .
I was able to get my projects building without the crash by reverting a single line in the PR that was doing extra filtering on the return of
forEachFileNameOfModulein src/compiler/moduleSpecifiers.ts.I am not sure if this is a complete fix and how it might interact with the desired behavior introduced by #42095.
dylanvorster commentedon Feb 28, 2021
have had to rollback to "typescript": "^4.1.5",. David Lannoye (@dlannoye) any chance you can open a PR?
andrewbranch commentedon Mar 1, 2021
Brandon Bayer (@flybayer) I can’t reproduce with your repo. I get a few checker errors but no crash:
David Lannoye (@dlannoye) (or actually anyone else who has seen this error), are you using pnpm or some other system that puts modules in a hidden folder (starting with
.) insidenode_modules? The line you reverted to fix your problem is supposed to filter out invalid module specifiers, and the crash means you were left with no valid module specifiers after the filtering. But if you’re not using pnpm, I’m very confused as to what was getting filtered out in the first place. If anyone can provide a small reproduction of this bug, that would be very helpful.flybayer commentedon Mar 1, 2021
Andrew Branch (@andrewbranch) run
yarn blitz prisma generateto fix those type errors, and thentscshould crash. That prisma command is supposed to run automatically. It generates code and typedefs atnode_modules/.prisma.andrewbranch commentedon Mar 1, 2021
Ah, yep, the
.prismais the culprit there. Are you supposed to be able to import from".prisma"? We assume that anything in a dotted folder in node_modules is a temporary path and should be ignored.flybayer commentedon Mar 1, 2021
Andrew Branch (@andrewbranch) no you import from
@prisma/client, which internally imports from.prismadlannoye commentedon Mar 1, 2021
Yes, I am using PNPM in my repository. The issue no longer reproduces if I clean and using npm instead for this project.
MaikuMori commentedon Mar 1, 2021
I have the same problem using
yarn, also withprismainstalled. I haven't tried to switch to npm.dlannoye commentedon Mar 2, 2021
Just tested my codebase with
"typescript": "4.3.0-dev.20210302"and can confirm that the assertion no longer reproduces. Thanks for the fix!sbalay commentedon Mar 3, 2021
Andrew Branch (@andrewbranch) do you know if this fix will be released soon?
andrewbranch commentedon Mar 3, 2021
Yes; it will (4.2.3)