commerce
commerce copied to clipboard
Failed to load next.config.js
How I ended up here
- Cloned the repo
- Added
.env.local
-
cd site
andyarn dev
.env.local
👇🏻
# Available providers:
# @vercel/commerce-local
# @vercel/commerce-bigcommerce
# @vercel/commerce-shopify
# @vercel/commerce-swell
# @vercel/commerce-saleor
# @vercel/commerce-spree
# @vercel/commerce-ordercloud
# @vercel/commerce-vendure
# @vercel/commerce-kibocommerce
# @vercel/commerce-commercejs
COMMERCE_PROVIDER=@vercel/commerce-vendure
BIGCOMMERCE_STOREFRONT_API_URL=
BIGCOMMERCE_STOREFRONT_API_TOKEN=
BIGCOMMERCE_STORE_API_URL=
BIGCOMMERCE_STORE_API_TOKEN=
BIGCOMMERCE_STORE_API_CLIENT_ID=
BIGCOMMERCE_CHANNEL_ID=
BIGCOMMERCE_STORE_URL=
BIGCOMMERCE_STORE_API_STORE_HASH=
BIGCOMMERCE_STORE_API_CLIENT_SECRET=
NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=
NEXT_PUBLIC_SWELL_STORE_ID=
NEXT_PUBLIC_SWELL_PUBLIC_KEY=
NEXT_PUBLIC_SALEOR_API_URL=
NEXT_PUBLIC_SALEOR_CHANNEL=
NEXT_PUBLIC_VENDURE_SHOP_API_URL=http://localhost:4000/shop-api
NEXT_PUBLIC_VENDURE_LOCAL_URL=http://localhost:4000/shop-api
ORDERCLOUD_CLIENT_ID=
ORDERCLOUD_CLIENT_SECRET=
STRIPE_SECRET=
KIBO_API_URL=
KIBO_CLIENT_ID=
KIBO_SHARED_SECRET=
KIBO_CART_COOKIE=
KIBO_CUSTOMER_COOKIE=
KIBO_API_HOST=
NEXT_PUBLIC_COMMERCEJS_PUBLIC_KEY=
NEXT_PUBLIC_COMMERCEJS_DEPLOYMENT_URL=
![image](https://user-images.githubusercontent.com/3351988/153044007-3a9c7d5b-5dbc-49d2-b12e-067f414458e8.png)
Update:
• Ran yarn turbo run build
from the root folder
• cd site
& yarn dev
and now I get this 👇🏻
`source` does not start with / for route {"source":"http://localhost:3000/:path*","destination":"http://localhost:4000/shop-api/:path*"}
Try installing the dependencies using the following in the directory you installed yarn:
For commerce.js:
yarn workspace @vercel/commerce run build
For local:
yarn workspace @vercel/commerce-local run build
For anything else just switch out the @vercel/... for whatever package is missing.
Same issue here, GoodChems suggestion doesn't work with yarn workspace @vercel/commerce-bigcommerce run build.
-
yarn turbo run build
in the root folder and thencd site && yarn dev
worked for me thanks @tharakabimal
Try this https://github.com/vercel/commerce/issues/681#issuecomment-1041921734
@tharakabimal see if this helps overriding the build command to cd .. && yarn build
https://github.com/vercel/commerce/issues/681#issuecomment-1046152179
Spinning up a local dev environment was working for me 16 days ago, March 4, but I ran into this error today. @GoodChem's comment solved it for me!
yarn workspace @vercel/commerce run build
yarn workspace @vercel/commerce-local run build
yarn workspace @vercel/commerce-shopify run build
after cloning this repo, and yarn install
- the issue for me was that next.config
was trying to importnode_modules/@vercel/commerce-local/dist
which for some reason was not present (all other builds dist
for eg. commerce-shopify
were there).
running yarn build
in packages
solved this issue.
Still happening to me and none of the solutions worked for me. I spent only 2 hours trying to run this project locally. It runs on the vercel but can't get it working locally. Has this happened to anyone else recently?
Hey there! Thank you for opening this issue. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: https://github.com/vercel/commerce/pull/966