stormy-gold•3mo ago
npm create refine-app@latest stalls when choosing nextjs
Hi,
I'm trying to get started with Refine but installation stalls when using the cli.
The initial options are Vite or Nextjs, if you choose Nextjs the install hangs.
Has anyone managed to get this to work, or is there a recommended work around?
Thanks
3 Replies
Hi @darryl. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
There have been several reports of installation issues or stalls when using
Make sure you are using the latest version of the CLI and try deleting your
Some users have reported better results using
If the build hangs during the
If you are running
Ensure you are using a supported Node.js version (Node 18 or 20 is recommended). Some users have reported issues with newer or unsupported Node versions. If you continue to experience issues, please provide your OS, Node.js version, and the exact steps you are following, as this can help narrow down the cause. Let me know if you need more specific troubleshooting steps! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
npm create refine-app@latest
with the Next.js template. One common cause is related to recent changes or issues in the antd
(Ant Design) dependency, which can cause the build process to hang indefinitely after project creation, especially when example pages are included. This is a known issue and has been discussed in the community. The Refine team has responded by locking the antd
version in their templates to avoid this problem, but if you are still experiencing it, it may be due to a cached or older template, or a new issue with dependencies.
Recommended Workarounds:
1. Try a Clean Install:Make sure you are using the latest version of the CLI and try deleting your
node_modules
and package-lock.json
(or pnpm-lock.yaml
/yarn.lock
) before running the install again.
2. Use a Different Package Manager:Some users have reported better results using
pnpm
instead of npm
, as pnpm
can be more resilient to network or dependency resolution issues. For example:
If you encounter issues with npm
, switching to pnpm
may help, especially on unreliable connections or when npm
stalls during package installation. This has been confirmed by users who had success with pnpm
after npm
failed for them Create refine-app crashing with SAOError.
3. Check for Ant Design Issues:If the build hangs during the
build
step, it may be due to a breaking change in antd
. The Refine team has locked the antd
version in their templates to mitigate this, but if you still encounter the issue, try downgrading antd
to a known working version (e.g., 5.37.4
) in your package.json
and reinstall dependencies. More details can be found in this discussion: Infinite build time after create refine-app.
4. Build Steps:If you are running
npm run start
without first running npm run build
, you may encounter errors. Always run npm run build
before npm run start
for production builds. For development, use npm run dev
cannot run nextjs project created with npm create refine-app.
5. Node Version:Ensure you are using a supported Node.js version (Node 18 or 20 is recommended). Some users have reported issues with newer or unsupported Node versions. If you continue to experience issues, please provide your OS, Node.js version, and the exact steps you are following, as this can help narrow down the cause. Let me know if you need more specific troubleshooting steps! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@336092510113890305> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
stormy-goldOP•3mo ago
I found an example in the Github repo.
npm create refine-app@latest -- --example with-nextjs