- Make sure you're still signed in into Saleor by refreshing the page
- Make sure you're using correct App token in your Vercel configuration
- You have to generate the app token as described in the Vercel deployment guide
- You cannot use the token from "Local apps", the token has to be connected with your installed Checkout App
- Reinstall the app in Saleor
- Uninstall the app in Saleor Dashboard
- Install the app again
- Generate new App token
- Update Vercel environment variables with new value of
SALEOR_APP_TOKEN
- Redeploy the app, don't use the "Redeploy with existing Build Cache" option
Check solutions for "Unauthorized" error
- Check country you're providing in checkout as shipping address
- It must be assigned to a shipping zone
- Check your shipping zone (Dashboard > Configuration > Shipping Methods):
- If it has a country assigned that you're using in checkout as shipping address
- If it has any shipping rate configured that:
- If it's assigned to the same channel as your checkout
mutation { checkoutCreate( input: { channel: "default-channel" # <- Channel slug must be the same as in shipping zone # ... ) { checkout { channel } } }
- If it's assigned to the same warehouse as products in your checkout
- Check the warehouse that has the products from your checkout (Dashboard > Configuration > Warehouses)
- Make sure you've enabled payment methods in Checkout App configuration
- Make sure you've configured payment gateway API keys
- Make sure you're using correct App token in your Vercel configuration
- Check solutions for "Unauthorized" error
The checkout was turned into an order in Saleor, thus deleting checkout session. You need to create a new checkout session.
Check in your project settings if you have "Include source files outside of the Root Directory in the Build Step" option enabled:
Check in your project settings if you've correctly selected the Root Directory.
If you need to know what Root Directory should be set, check the deployment guide for:
Clear .next
folder inside app or package that's producing this issue
rm -rf apps/storefront/.next
By default .env
file uses environment variables that are when the project is run from the root of monorepo (e.g. pnpm run dev --filter=saleor-app-checkout
).
If the project is run from this directory (e.g. cd apps/saleor-app-checkout && pnpm run dev
) then those variables wouldn't be available. That's why env-vars
package is used for loading both env variables from root of monorepo and from the project directory.
For more details check env-vars
package.
-
Check order of your env variables. They are loaded in this order:
apps/**/.env.local
apps/**/.env.development
apps/**/.env
.env.local
(root of monorepo).env
(root of monorepo) If you define a variable with the same name in.env.local
and in.env
then the variable from.env.local
takes precedence.
-
Check order of your env variables in the file. Variables defined later in the file, override already defined variables. For example:
MY_ENV=initial_value
# ...
MY_ENV=overriden_value # this overrides `initial_value` with `overriden_value`
- Check if you're accessing the variables in correct way: dynamic lookups to
process.env
won't work in the browser. Read more in Next.js docs
To load environment variables in other packages, that don't use Next.js make sure to import env-vars
package.
You can do this by:
- using
--require
parameter in Node CLI:
node --require 'env-vars' index.js
- Using
NODE_OPTIONS
env variable to pass parameters like you would do with Node CLI:
NODE_OPTIONS='--require 'env-vars'' my_command
- Import the package at the top of your entry file (ex.
index.js
)
import "env-vars";
// or with CommonJS
require("env-vars");