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

[legacy-framework] Fix Cannot read property 'toString' of null for blitz new #2025

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

roshan-sama
Copy link
Collaborator

Closes: blitz-js/legacy-framework#523

What are the changes and their implications?

Adding checks to make sure the checkYarn buffer and its stdout are not null or undefined before calling .toString() on them. This ensures that the useYarn variable which determines whether we use yarn or npm to upgrade blitz is properly set, and the rest of the upgrade happens without an error being thrown if the user doesn't have yarn installed

Checklist

  • Changes covered by tests (tests added if needed)
    I was unable to test this because the issue was only occurring when I didn't have yarn installed, but I needed yarn installed and needed to be running the yarn dev command in order to run the commands using the local blitz version I was working on in the example directory
  • PR submitted to blitzjs.com for any user facing changes

@flybayer
Copy link
Member

flybayer commented Mar 1, 2021

Woohoo, thank you!

@all-contributors add @roesh for code

@allcontributors
Copy link

@flybayer

I've put up a pull request to add @roesh! 🎉

@flybayer flybayer changed the title Add null check to prevent error in blitz new's upgrade prompt Fix Cannot read property 'toString' of null for blitz new Mar 1, 2021
@flybayer flybayer merged commit d2e5368 into blitz-js:canary Mar 1, 2021
@itsdillon itsdillon changed the title Fix Cannot read property 'toString' of null for blitz new [legacy-framework] Fix Cannot read property 'toString' of null for blitz new Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempting to upgrade the global blitz version from the blitz new prompt fails
2 participants