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

Check for undefined globalObjectType in getPropertyOfObjectType #47183

Closed

Conversation

sandersn
Copy link
Member

This can happen during symbol merging when initialising the checker, because global types aren't set until after symbols are merged.

May stop the crashes in #47179, #47181, #47180.
Does not address the underlying problem of needing to resolve aliases, and therefore names, during symbol merging when initialising the checker.

I created this PR so it would be easier for others to see if this is actually fixes their crashes.

This can happen during symbol merging when initialising the checker,
because global types aren't set until after symbols are merged.

May stop the crashes in #47179, #47181, #47180.
Does not address the underlying problem of needing to resolve aliases,
and therefore names, during symbol merging when initialising the
checker.
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Dec 17, 2021
@sandersn
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 17, 2021

Heya @sandersn, I've started to run the tarball bundle task on this PR at 9256e11. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 18, 2021

Hey @sandersn, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/116605/artifacts?artifactName=tgz&fileId=AC9FB8B90852A2E48416FC17CFC8EAC1B7B6C2B711D45AF0744903EFFF4F806802&fileName=/typescript-4.6.0-insiders.20211217.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@4.6.0-pr-47183-2".;

@SegaraRai
Copy link

I manually patched it into node_modules/typescript/lib/*.js and it works!

@JoshuaKGoldberg
Copy link
Contributor

Yes! This fixes the crash in tsdjs/tsd#137. FYI @sandersn if you're looking for a repro. The name parameter there is ___esModule.

@DanielRosenwasser
Copy link
Member

I switched to && and added a comment. We still need a repro though.

@DanielRosenwasser
Copy link
Member

@JoshuaKGoldberg do you remember what you did to get that crash?

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Dec 21, 2021

Oh sorry I wasn't clear @DanielRosenwasser -- the real issue report is tsdjs/tsd#136.

git clone https://github.com/League-of-Foundry-Developers/foundry-vtt-types
cd foundry-vtt-types
git checkout 6cd18412b0ab71584951d4fb1f2a08482aba495d
npm i
npm run test

Note that it uses tsd's @tsd/typescript and tsd doesn't give a full error stack. tsdjs/tsd#137 suggests a fix: changing dist/cli.js to console.log(Error).

@sandersn
Copy link
Member Author

We're going with the fix at #47348

@sandersn
Copy link
Member Author

It might be worth sorting through the initialisation problems that this PR partly fixes, though.

@sandersn sandersn closed this Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants