chore: merge master

This commit is contained in:
Sebastian Rindom
2021-12-08 09:56:59 +01:00
28 changed files with 3866 additions and 2944 deletions
@@ -0,0 +1,21 @@
# CORS issues
If you are experiencing connection issues when trying to access your Medusa instance from a storefront, it is most likely due to CORS issues.
You might see a log in your browser console, that looks like this:
![CORS error log](https://i.imgur.com/jnHK115.png)
In your `medusa-config.js` , you should ensure that you've configured your CORS settings correctly. By default, the Medusa starter run on port 9000, Medusa Admin on port 7000, and the storefront starters on port 8000.
The default configuration uses the following CORS settings:
```jsx
// CORS when consuming Medusa from admin
const ADMIN_CORS = process.env.ADMIN_CORS || "http://localhost:7000"
// CORS to avoid issues when consuming Medusa from a client
const STORE_CORS = process.env.STORE_CORS || "http://localhost:8000"
```
If you wish to run your storefront or Medusa admin on other ports, you should update the above settings accordinly.
@@ -0,0 +1,32 @@
# Stripe not showing in checkout
You add payment providers to your Medusa instance by adding them as plugins in `medusa-config.js`:
```jsx
const plugins = [
...
// You can create a Stripe account via: https://stripe.com
{
resolve: `medusa-payment-stripe`,
options: {
api_key: STRIPE_API_KEY,
webhook_secret: STRIPE_WEBHOOK_SECRET,
},
},
...
];
```
And installing them through your favourite package manager:
```bash
yarn add medusa-payment-stripe
# or
npm install medusa-payment-stripe
```
Though, to be able to also show them as part of your checkout flow, you need to add them to your regions.
In Medusa Admin go to Settings -> Regions and select your newly added payment provider:
![](https://i.imgur.com/CfR9BCV.png)
@@ -0,0 +1,25 @@
# Redis not emitting events
When you create a new Medusa project, Redis is disabled by default. Instead, we use a fake Redis server, that allows you to start your project, but holds no functionality.
To enable a real Redis server, you need to install and start it up on your PC. Install it directly from their [website](https://redis.io/download) or use Homebrew and run the following commands:
```bash
brew install redis
brew services start redis
```
Additonally, ensure that `redis_url` is not commented out in your project configuration in the bottom of your `medusa-config.js`.
```jsx
module.exports = {
projectConfig: {
redis_url: REDIS_URL, // <-- Enables a real Redis server
database_url: DATABASE_URL,
database_type: "postgres",
store_cors: STORE_CORS,
admin_cors: ADMIN_CORS,
},
plugins,
}
```
@@ -0,0 +1,13 @@
# Signing in to Medusa Admin
If you've created a new Medusa project and seeded the database using our predefined script, the default credentials are:
```bash
admin@medusa-test.com // supersecret
```
Though, you can create your own users using our CLI:
```
medusa user -e some@email.com -p somepassword
```
@@ -0,0 +1,37 @@
# Error 409 in checkout
To provide the most frictionless onboarding and quick start, we default to SQLite as database. SQLite runs on all PCs, which is why it allows you to get quickly started without installing Postgres. Though, it comes at the expense of important features, that are needed in a production environment.
Therefore, you might experience the following error when going through a checkout flow in our starters:
```
Error: Transaction already started for the given connection, commit current transaction before starting a new one.
```
This error occurs because SQLite does not allow for multiple write transactions at the same time. To resolve it, you need to use Postgres instead.
First install and start Postgres on your local machine. You can either [download it directly from their website](https://www.postgresql.org/download/) or use Homebrew:
```bash
brew install postgresql
brew services start postgresql
createdb
```
Then in your `medusa-config.js`, you should change the project config to use Postgres as database type:
```jsx
module.exports = {
projectConfig: {
redis_url: REDIS_URL,
// The following two lines will enable Postgres
database_url: DATABASE_URL,
database_type: "postgres",
store_cors: STORE_CORS,
admin_cors: ADMIN_CORS,
},
plugins,
}
```
> When changing from SQLite to Postgres, you should seed the database again using: `yarn seed`