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

[Bug?]: Generators Cannot read properties of undefined (reading 'startsWith') #9760

Closed
1 task
xmaxcooking opened this issue Dec 27, 2023 · 5 comments
Closed
1 task
Labels
bug/needs-info More information is needed for reproduction

Comments

@xmaxcooking
Copy link
Contributor

xmaxcooking commented Dec 27, 2023

What's not working?

I've run into this issue:

Cannot read properties of undefined (reading 'startsWith')
◼ Generating types ...
Error applying template at F:\Git\my-redwood-project\node_modules\@redwoodjs\cli\dist\commands\generate\cell\templates\cell.tsx.template for Profile: Cannot read properties of undefined (reading 'startsWith')`

when running yarn rw g cell Profile

After backtracking my steps to a working state I found the issue to be that I installed prettier because of the yarn install warnings.

➤ YN0002: │ root-workspace-0b6124@workspace:. doesn't provide prettier (pfdc36), requested by prettier-plugin-tailwindcss.

I'm unsure if this is a redwood bug but either way it's good to document this here for others to find.

How do we reproduce the bug?

yarn create redwood-app my-redwood-project --typescript
cd my-redwood-project
yarn install 
yarn rw setup ui tailwindcss
yarn add prettier -D
yarn rw g component Broken

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this
@xmaxcooking xmaxcooking added the bug/needs-info More information is needed for reproduction label Dec 27, 2023
@xmaxcooking xmaxcooking changed the title [Bug?]: Generators broken if you install prettier [Bug?]: Generators broken if you add prettier Dec 27, 2023
@xmaxcooking xmaxcooking changed the title [Bug?]: Generators broken if you add prettier [Bug?]: Generators Cannot read properties of undefined (reading 'startsWith') Dec 27, 2023
@Tobbe
Copy link
Member

Tobbe commented Dec 27, 2023

@xmaxcooking What version of prettier did that install for you?

@xmaxcooking
Copy link
Contributor Author

xmaxcooking commented Dec 27, 2023

Hi @Tobbe!👋

"@redwoodjs/core": "6.6.0",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "0.4.1"

@Tobbe
Copy link
Member

Tobbe commented Dec 27, 2023

Yeah, unfortunately RW doesn't work with prettier v3 yet. See more here #9077

That's still a pretty weird error to be getting though 🤔
Seeing how it's Cell related I'm worried it's somehow caused by this PR #8264

@xmaxcooking
Copy link
Contributor Author

xmaxcooking commented Dec 27, 2023

That's still a pretty weird error to be getting though 🤔 Seeing how it's Cell related I'm worried it's somehow caused by this PR #8264

Actually all generators were broken for me not just the cells.

@xmaxcooking
Copy link
Contributor Author

xmaxcooking commented Dec 27, 2023

@Tobbe I just verified this and everything works with prettier@2.8.8

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

3 participants
@Tobbe @xmaxcooking and others