docs: add new troubleshooting section for create-medusa-app (#6071)
* docs: add new troubleshooting section for create-medusa-app * small fixes
This commit is contained in:
@@ -18,6 +18,7 @@ import EaddrinuseSection from './troubleshooting/eaddrinuse.md'
|
|||||||
import InvalidTokenError from './troubleshooting/create-medusa-app-errors/_no-browser-token-error.md'
|
import InvalidTokenError from './troubleshooting/create-medusa-app-errors/_no-browser-token-error.md'
|
||||||
import PostgresDockerError from './troubleshooting/database-errors/_docker.md'
|
import PostgresDockerError from './troubleshooting/database-errors/_docker.md'
|
||||||
import DbUrlError from './troubleshooting/create-medusa-app-errors/_db-url-error.md'
|
import DbUrlError from './troubleshooting/create-medusa-app-errors/_db-url-error.md'
|
||||||
|
import PortError from './troubleshooting/create-medusa-app-errors/_port.md'
|
||||||
|
|
||||||
# Install Medusa with create-medusa-app
|
# Install Medusa with create-medusa-app
|
||||||
|
|
||||||
@@ -218,6 +219,10 @@ Based on what you're building, you can find a development path for you in the Re
|
|||||||
|
|
||||||
<DetailsList
|
<DetailsList
|
||||||
sections={[
|
sections={[
|
||||||
|
{
|
||||||
|
title: "Admin Login or User Errors",
|
||||||
|
content: <PortError />
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Can\'t connect to database with --db-url option',
|
title: 'Can\'t connect to database with --db-url option',
|
||||||
content: <DbUrlError />
|
content: <DbUrlError />
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import OtherErrors from './create-medusa-app-errors/_other-errors.mdx'
|
|||||||
import InvalidTokenError from './create-medusa-app-errors/_no-browser-token-error.md'
|
import InvalidTokenError from './create-medusa-app-errors/_no-browser-token-error.md'
|
||||||
import DockerSection from "./database-errors/_docker.md"
|
import DockerSection from "./database-errors/_docker.md"
|
||||||
import DbUrlError from './create-medusa-app-errors/_db-url-error.md'
|
import DbUrlError from './create-medusa-app-errors/_db-url-error.md'
|
||||||
|
import PortError from './create-medusa-app-errors/_port.md'
|
||||||
|
|
||||||
## TypeError: cmd is not a function
|
## TypeError: cmd is not a function
|
||||||
|
|
||||||
@@ -14,6 +15,12 @@ import DbUrlError from './create-medusa-app-errors/_db-url-error.md'
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Admin Login or User Errors
|
||||||
|
|
||||||
|
<PortError />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Invalid Token Error with --no-browser Option
|
## Invalid Token Error with --no-browser Option
|
||||||
|
|
||||||
<InvalidTokenError />
|
<InvalidTokenError />
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
By default, the Medusa backend runs on `localhost:9000`. However, the port may change based on the `PORT` environment variable.
|
||||||
|
|
||||||
|
If you run the `create-medusa-app` command, and the installation finishes successfully, but the backend runs on a different port than `9000`, it may cause errors when you try to create an admin user or login during the onboarding process. This could either be because you have the `PORT` environment variable set to something differnt, or because of port forwarding.
|
||||||
|
|
||||||
|
To resolve this, you must:
|
||||||
|
|
||||||
|
1. Terminate the `create-medusa-app` process and change to the new backend's directory.
|
||||||
|
2. Either explicitely set the `PORT` environment variable to `9000`, or set the environment variable `MEDUSA_ADMIN_BACKEND_URL` to the backend's URL. For example, if the backend is running on `localhost:7000`, change the `MEDUSA_ADMIN_BACKEND_URL` to `http://localhost:7001`. This ensures that the admin uses the correct port. In case of port fowarding, it's recommended to explicitely set the `PORT` environment variable.
|
||||||
|
3. Create an admin user using the [user command of the CLI tool](../../cli/reference.mdx#user).
|
||||||
|
4. Start the backend again either with the `dev` command of the backend project or using `npx medusa develop` and try to login again.
|
||||||
Reference in New Issue
Block a user