Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load next.config.js #674

Closed
tharakabimal opened this issue Feb 8, 2022 · 10 comments
Closed

Failed to load next.config.js #674

tharakabimal opened this issue Feb 8, 2022 · 10 comments

Comments

@tharakabimal
Copy link

tharakabimal commented Feb 8, 2022

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
Copy link
Author

tharakabimal commented Feb 8, 2022

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
Copy link

GoodChem commented Feb 8, 2022

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
Copy link

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

@philsmithies
Copy link

philsmithies commented Feb 11, 2022

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

worked for me thanks @tharakabimal

@aubryll
Copy link

aubryll commented Feb 16, 2022

Try this #681 (comment)

@gregonarash
Copy link

@tharakabimal see if this helps overriding the build command to cd .. && yarn build #681 (comment)

@jenniferhail
Copy link

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
Copy link

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
Copy link

frvnkhl commented Apr 4, 2023

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
Copy link
Member

leerob commented Apr 18, 2023

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: #966

@leerob leerob closed this as completed Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants