robust-apricot
robust-apricot•16mo ago

Differences between code generated using create-refine-app through yarn vs through npm

Hey all, just started learning about Refine today and went to start the tutorial using the headless version. I initially generated the Refine project using yarn as package manager. The project was created successfully, but when I went to go look at the generated App.tsx I saw that it was poorly formatted with lots of whitespace and unused imports. I tried installing Refine through npm instead and the code generated looked much better. Please see the attached screenshot - the yarn version is on the left and the npm version is on the right. Is the yarn installer working with an older version of the boilerplate? What accounts for the difference?
No description
10 Replies
kapa.ai
kapa.ai•16mo ago
Hi @unwrong. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai•16mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, the tutorial you mentioned suggests using the following command to create a new project with yarn:
yarn create refine-app -- -o refine-headless tutorial
yarn create refine-app -- -o refine-headless tutorial
Please note that it only supports yarn@1 version (source (https://refine.dev/docs/tutorial/getting-started/headless/create-project)). If you still encounter issues with the generated code, I recommend checking the Refine documentation (https://refine.dev/docs) and Refine blog (https://refine.dev/blog) for more information. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Overview | refine
What is refine?
Blog | refine
A Docusaurus powered blog!
kapa.ai
kapa.ai•16mo ago
<@706871839145590905> kapa.ai is still learning and improving, please let us how it did by reacting below
sensitive-blue
sensitive-blue•16mo ago
it's not expected behavior. Thank you for the issue report. We will investigate the issue
robust-apricot
robust-apricot•16mo ago
Awesome, thanks for the speedy response. If it helps at all, I used exactly the commands suggested on the tutorial page: yarn create refine-app -- -o refine-headless tutorial and npm create refine-app@latest -- -o refine-headless tutorial with the only difference being that I called my project folders something different.
sensitive-blue
sensitive-blue•16mo ago
When you add latest to yarn. is it good ?
robust-apricot
robust-apricot•16mo ago
I'll try now. I tried: yarn create refine-app@latest -- -o refine-headless tutorial and got an error saying that ".yarn/bin/create-refine-app@latest" could not be found. Is there an alternate command in yarn to specify the latest version?
sensitive-blue
sensitive-blue•16mo ago
I don't know. We will look into it tomorrow. its getting late where i live 🥹 Meanwhile please use npm. After that you can manually migrate to yarn ofc
robust-apricot
robust-apricot•16mo ago
Haha, for sure. Thanks for the help.
sensitive-blue
sensitive-blue•16mo ago
Thanks for the bugreport