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

codemod at least has a typo, and maybe other problems #4334

Open
Vandivier opened this issue May 10, 2024 · 4 comments · May be fixed by #4335
Open

codemod at least has a typo, and maybe other problems #4334

Vandivier opened this issue May 10, 2024 · 4 comments · May be fixed by #4335
Labels
kind/bug Something isn't working status/triage

Comments

@Vandivier
Copy link
Contributor

What is the problem?

when i run npx @blitzjs/codemod upgrade-legacy as instructed in https://blitzjs.com/docs/upgrading-from-framework, I see an error:
App directory doesn't exit

On inspection, this is a typo which should read
App directory doesn't exist

A deeper issue, though, is that I don't expect the app dir to pre-exist. I'm expecting the code mod to create it, because I am expecting this upgrade to move from pages dir to app dir along with the rest of the upgrade.

Paste all your error logs here:

PASTE_HERE (leave the ``` marks)

Paste all relevant code snippets here:

PASTE_HERE (leave the ``` marks)

What are detailed steps to reproduce this?

Run blitz -v and paste the output here:

PASTE_HERE (leave the ``` marks)

Please include below any other applicable logs and screenshots that show your problem:

No response

@Vandivier Vandivier added kind/bug Something isn't working status/triage labels May 10, 2024
@Vandivier Vandivier linked a pull request May 10, 2024 that will close this issue
@Vandivier
Copy link
Contributor Author

some other problems:

  1. if i have next.config.js instead of blitz.config.js the codemod unnecessarily errors
  2. it errors if i don't have an app dir. maybe this is proper? but can it just make an app dir?
  3. it errors after inserting import { withBlitz } from "app/blitz-client"; blindly, if it was already in the file under insertion; instead, the mod should check ahead of time and only insert if needed

@Vandivier
Copy link
Contributor Author

error for 3 above:
image

@Vandivier
Copy link
Contributor Author

i fixed the above manually, now i got this:
image

@Vandivier
Copy link
Contributor Author

Vandivier commented May 10, 2024

ran at ref Vandivier/ladderly-3#220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant