docs: added troubleshooting for Next.js with NPX (#5016)
This commit is contained in:
@@ -66,6 +66,26 @@ npx create-medusa-app@latest --with-nextjs-starter
|
|||||||
|
|
||||||
Refer to the [create-medusa-app](../create-medusa-app.mdx) documentation for more details on prerequisites, steps, and troubleshooting.
|
Refer to the [create-medusa-app](../create-medusa-app.mdx) documentation for more details on prerequisites, steps, and troubleshooting.
|
||||||
|
|
||||||
|
### Troubleshooting: Next.js Storefront Not Working
|
||||||
|
|
||||||
|
By default, the command above will start both the Medusa backend at `localhost:9000` and the Next.js storefront at `localhost:8000` once the installation finishes successfully. The Medusa admin will also open in your default browser.
|
||||||
|
|
||||||
|
If, while following along the setup process, you try to access the Next.js storefront and it's not working, try to run the storefront manually while the Medusa backend is still running.
|
||||||
|
|
||||||
|
To do that, first, change to the directory of the storefront. The directory name is `<PROJECT_NAME>-storefront`, where `<PROJECT_NAME>` is the name you chose for the project while running the `create-medusa-app` command. For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd my-medusa-store-storefront
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, run the following command to start the storefront:
|
||||||
|
|
||||||
|
```bash npm2yarn
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The storefront should run on `localhost:8000` now.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Option 2: Install Next.js Storefront Only
|
## Option 2: Install Next.js Storefront Only
|
||||||
|
|||||||
Reference in New Issue
Block a user