commerce icon indicating copy to clipboard operation
commerce copied to clipboard

Failed to load next.config.js

Open tharakabimal opened this issue 2 years ago • 8 comments

How I ended up here

  1. Cloned the repo
  2. Added .env.local
  3. cd site and yarn 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

tharakabimal avatar Feb 08 '22 17:02 tharakabimal

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*"}

tharakabimal avatar Feb 08 '22 17:02 tharakabimal

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.

GoodChem avatar Feb 08 '22 21:02 GoodChem

Same issue here, GoodChems suggestion doesn't work with yarn workspace @vercel/commerce-bigcommerce run build.

Paulus90 avatar Feb 10 '22 13:02 Paulus90

  • yarn turbo run build in the root folder and then cd site && yarn dev

worked for me thanks @tharakabimal

philsmithies avatar Feb 11 '22 10:02 philsmithies

Try this https://github.com/vercel/commerce/issues/681#issuecomment-1041921734

aubryll avatar Feb 16 '22 17:02 aubryll

@tharakabimal see if this helps overriding the build command to cd .. && yarn build https://github.com/vercel/commerce/issues/681#issuecomment-1046152179

gregonarash avatar Feb 20 '22 03:02 gregonarash

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

jenniferhail avatar Mar 20 '22 05:03 jenniferhail

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.

SpareShade avatar May 22 '22 02:05 SpareShade

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?

frvnkhl avatar Apr 04 '23 18:04 frvnkhl

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

leerob avatar Apr 18 '23 02:04 leerob