vercel / commerce

Next.js Commerce
https://demo.vercel.store
MIT License
11.55k stars 4.26k forks source link

Failed to load next.config.js #674

Closed tharakabimal closed 1 year ago

tharakabimal commented 2 years ago

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 commented 2 years ago

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*"}
GoodChem commented 2 years ago

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.

Paulus90 commented 2 years ago

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

philsmithies commented 2 years ago

worked for me thanks @tharakabimal

aubryll commented 2 years ago

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

gregonarash commented 2 years ago

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

jenniferhail commented 2 years ago

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
SpareShade commented 2 years ago

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.

frvnkhl commented 1 year ago

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?

leerob commented 1 year ago

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