Git Product home page Git Product logo

nextjs-starter-medusa's Introduction

Medusa logo

Medusa Next.js Starter Template

Combine Medusa's modules for your commerce backend with the newest Next.js 14 features for a performant storefront.

PRs welcome! Discord Chat Follow @medusajs

Prerequisites

To use the Next.js Starter Template, you should have a Medusa server running locally on port 9000. For a quick setup, run:

npx create-medusa-app@latest

Check out create-medusa-app docs for more details and troubleshooting.

Overview

The Medusa Next.js Starter is built with:

Features include:

  • Full ecommerce support:
    • Product Detail Page
    • Product Overview Page
    • Search with Algolia / MeiliSearch
    • Product Collections
    • Cart
    • Checkout with PayPal and Stripe
    • User Accounts
    • Order Details
  • Full Next.js 14 support:
    • App Router
    • Next fetching/caching
    • Server Components
    • Server Actions
    • Streaming
    • Static Pre-Rendering

Quickstart

Setting up the environment variables

Navigate into your projects directory and get your environment variables ready:

cd nextjs-starter-medusa/
mv .env.template .env.local

Install dependencies

Use Yarn to install all dependencies.

yarn

Start developing

You are now ready to start up your project.

yarn dev

Open the code and start customizing

Your site is now running at http://localhost:8000!

Payment integrations

By default this starter supports the following payment integrations

To enable the integrations you need to add the following to your .env.local file:

NEXT_PUBLIC_STRIPE_KEY=<your-stripe-public-key>
NEXT_PUBLIC_PAYPAL_CLIENT_ID=<your-paypal-client-id>

You will also need to setup the integrations in your Medusa server. See the Medusa documentation for more information on how to configure Stripe and PayPal in your Medusa project.

Search integration

This starter is configured to support using the medusa-search-meilisearch plugin out of the box. To enable search you will need to enable the feature flag in ./store.config.json, which you do by changing the config to this:

{
  "features": {
    // other features...
    "search": true
  }
}

Before you can search you will need to install the plugin in your Medusa server, for a written guide on how to do this – see our documentation.

The search components in this starter are developed with Algolia's react-instant-search-hooks-web library which should make it possible for you to seemlesly change your search provider to Algolia instead of MeiliSearch.

To do this you will need to add algoliasearch to the project, by running

yarn add algoliasearch

After this you will need to switch the current MeiliSearch SearchClient out with a Alogolia client. To do this update @lib/search-client.

import algoliasearch from "algoliasearch/lite"

const appId = process.env.NEXT_PUBLIC_SEARCH_APP_ID || "test_app_id" // You should add this to your environment variables

const apiKey = process.env.NEXT_PUBLIC_SEARCH_API_KEY || "test_key"

export const searchClient = algoliasearch(appId, apiKey)

export const SEARCH_INDEX_NAME =
  process.env.NEXT_PUBLIC_INDEX_NAME || "products"

Then, in src/app/(main)/search/actions.ts, remove the MeiliSearch code (line 10-16) and uncomment the Algolia code.

"use server"

import { searchClient, SEARCH_INDEX_NAME } from "@lib/search-client"

/**
 * Uses MeiliSearch or Algolia to search for a query
 * @param {string} query - search query
 */
export async function search(query: string) {
  const index = searchClient.initIndex(SEARCH_INDEX_NAME)
  const { hits } = await index.search(query)

  return hits
}

After this you will need to set up Algolia with your Medusa server, and then you should be good to go. For a more thorough walkthrough of using Algolia with Medusa – see our documentation, and the documentation for using react-instantsearch-hooks-web.

App structure

For the new version, the main folder structure remains unchanged. The contents have changed quite a bit though.

.
└── src
    ├── app
    ├── lib
    ├── modules
    ├── styles
    ├── types
    └── middleware.ts

/app directory

The app folder contains all Next.js App Router pages and layouts, and takes care of the routing.

.
└── [countryCode]
    ├── (checkout)
        └── checkout
    └── (main)
        ├── account
        │   ├── addresses
        │   └── orders
        │       └── details
        │           └── [id]
        ├── cart
        ├── categories
        │   └── [...category]
        ├── collections
        │   └── [handle]
        ├── order
        │   └── confirmed
        │       └── [id]
        ├── products
        │   └── [handle]
        ├── results
        │   └── [query]
        ├── search
        └── store

The app router folder structure represents the routes of the Starter. In this case, the structure is as follows:

  • The root directory is represented by the [countryCode] folder. This indicates a dynamic route based on the country code. The this will be populated by the countries you set up in your Medusa server. The param is then used to fetch region specific prices, languages, etc.
  • Within the root directory, there two Route Groups: (checkout) and (main). This is done because the checkout flow uses a different layout. All other parts of the app share the same layout and are in subdirectories of the (main) group. Route Groups do not affect the url.
  • Each of these subdirectories may have further subdirectories. For instance, the account directory has addresses and orders subdirectories. The orders directory further has a details subdirectory, which itself has a dynamic [id] subdirectory.
  • This nested structure allows for specific routing to various pages within the application. For example, a URL like /account/orders/details/123 would correspond to the account > orders > details > [id] path in the router structure, with 123 being the dynamic [id].

This structure enables efficient routing and organization of different parts of the Starter.

/lib directory

The lib directory contains all utilities like the Medusa JS client functions, util functions, config and constants.

The most important file here is /lib/data/index.ts. This file defines various functions for interacting with the Medusa API, using the JS client. The functions cover a range of actions related to shopping carts, orders, shipping, authentication, customer management, regions, products, collections, and categories. It also includes utility functions for handling headers and errors, as well as some functions for sorting and transforming product data.

These functions are used in different Server Actions.

/modules directory

This is where all the components, templates and Server Actions are, grouped by section. Some subdirectories have an actions.ts file. These files contain all Server Actions relevant to that section of the app.

/styles directory

global.css imports Tailwind classes and defines a couple of global CSS classes. Tailwind and Medusa UI classes are used for styling throughout the app.

/types directory

Contains global TypeScript type defintions.

middleware.ts

Next.js Middleware, which is basically an Edge function that runs before (almost) every request. In our case it enforces a countryCode in the url. So when a user visits any url on your storefront without a countryCode param, it will redirect the user to the url for the most relevant region.

The region will be decided as follows:

  • When deployed on Vercel and you’re active in the user’s current country, it will use the country code from the x-vercel-ip-country header.
  • Else, if you have defined a NEXT_PUBLIC_DEFAULT_REGION environment variable, it will redirect to that.
  • Else, it will redirect the user to the first region it finds on your Medusa server.

If you want to use the countryCode param in your code, there’s two ways to do that:

  1. On the server in any page.tsx - the countryCode is in the params object:

    export default async function Page({
      params: { countryCode },
    }: {
      params: { countryCode: string }
    }) {
      const region = await getRegion(countryCode)
    
    // rest of code
  2. From client components, with the useParam hook:

    import { useParams } from "next/navigation"
    
    const Component = () => {
    	const { countryCode } = useParams()
    	
    	// rest of code

The middleware also sets a cookie based on the onboarding status of a user. This is related to the Medusa Admin onboarding flow, and may be safely removed in your production storefront.

Resources

Learn more about Medusa

Learn more about Next.js

nextjs-starter-medusa's People

Contributors

anshuman71 avatar avneesh0612 avatar chemicalkosek avatar chrislaai avatar csmalhi avatar dependabot[bot] avatar dinesh-58 avatar festelle avatar fpolic avatar kasperkristensen avatar lahouely avatar lopataa avatar luluhoc avatar max-prokopenko avatar medusanick avatar minhtungo avatar olivermrbl avatar paulrollo avatar qacomet avatar seek4samurai avatar shahednasser avatar shnoman97 avatar stephangriesel avatar stnguyen90 avatar techjeffharris avatar tnmyk avatar usamaadev avatar variablevic avatar wangjue666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nextjs-starter-medusa's Issues

Error: Network Error starting medusa storefront nextjs service

I installed medusa storefront nextjs, updated all the packages, made all the necessary settings in next.config.js and store.config.js, but whenever I start the service, I receive the following error in the browser:

1

Errors in browser console:

2

Errors in network browser:

3

It seems to me to be a CORS error, but I correctly configured the url of store_cors and admin_cors in the medusa-server .env

4
5
6

Services and versions:

Node.js v16.16.0, @medusajs/medusa v1.6.3, medusa-react v3.0.1", next v12.2.0, react v17.0.2,

Region Selection reset to default state, but UI dropdown still show previous selected region

Bug report

Describe the bug

You need to have multiple Region setup, pick one that not your first region ,latest you created and do a checkout .
Check with an address for that region well its mandatory anyways.
all good.

Now try to do a second checkout and error in console.

Request URL: http://localhost:9000/store/carts/cart_01G8J6CRJV2FK08A6394QW8HM7
Request Method: POST
Status Code: 400 Bad Request

{type: "invalid_data", message: "Shipping country must be in the cart region"}
message: "Shipping country must be in the cart region"
type: "invalid_data"

I can also see my tax is different now but the UI dropdown for region is still showing the correct region
But look like the Actual state of the save region have reverse to default( i guess the first one not sure)

Additional context

If i re-reselect the region from the the dropdown, i can checkout

Expected behavior

if a region is selected/loaded, it stay

Auto Select Country

Currently, the starter will automatically select the region if provided by the response from the Create a Cart API call, but it won't select the country even if cart.shipping_address.country_code is set.

Error when trying to check out

image
Getting this error in /checkout page. I have configured test stripe public key as well as secret in medusa admin.
Can you please look into this? Thanks!

TypeError: Cannot read properties of undefined (reading 'toLowerCase')

Hi, I follow the instruction but get the following error when I start the web app.

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'toLowerCase')

Source
utils/prices.js (24:64) @ eval

22 |
23 | let moneyAmount = variant.prices.find(

24 | (p) => p.currency_code.toLowerCase() === cart.currency_code.toLowerCase()
| ^
25 | );
26 |
27 | if (moneyAmount && moneyAmount.amount) {

Demo is broken

Suggestion: specifying in the README that nextjs-starter-medusa is an SSR project

Hi,

What do you think about specifying in the README whether this project is designed to operate in an SSR (Server Side Rendering), SSG (Static Site Generation) or SPA (Singe Page App) mode?

I think nextjs-starter-medusa is an SSR project, because when I launch yarn run build I have this error if medusa backend isn't started:

#0 0.885 info  - Linting and checking validity of types...
#0 6.489 info  - Creating an optimized production build...
#0 17.52 info  - Compiled successfully
#0 17.52 info  - Collecting page data...
#0 24.50 Error: connect ECONNREFUSED 127.0.0.1:9000
#0 24.50     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
#0 24.50   errno: -111,
#0 24.50   code: 'ECONNREFUSED',
#0 24.50   syscall: 'connect',
#0 24.50   address: '127.0.0.1',
#0 24.50   port: 9000,
#0 24.50   config: {
#0 24.50     transitional: {
#0 24.50       silentJSONParsing: true,
#0 24.50       forcedJSONParsing: true,
#0 24.50       clarifyTimeoutError: false
#0 24.50     },
#0 24.50     adapter: [Function: httpAdapter],
#0 24.50     transformRequest: [ [Function: transformRequest] ],
#0 24.50     transformResponse: [ [Function: transformResponse] ],
#0 24.50     timeout: 0,
#0 24.50     xsrfCookieName: 'XSRF-TOKEN',
#0 24.50     xsrfHeaderName: 'X-XSRF-TOKEN',
#0 24.50     maxContentLength: -1,
#0 24.50     maxBodyLength: -1,
#0 24.50     validateStatus: [Function: validateStatus],
#0 24.50     headers: {
#0 24.50       Accept: 'application/json',
#0 24.50       'Content-Type': 'application/json',
#0 24.50       'User-Agent': 'axios/0.24.0'
#0 24.50     },
#0 24.50     baseURL: 'http://localhost:9000',
#0 24.50     raxConfig: {
#0 24.50       instance: [Function],
#0 24.50       retry: 3,
#0 24.50       backoffType: 'exponential',
#0 24.50       shouldRetry: [Function: shouldRetry],
#0 24.50       currentRetryAttempt: 3,
#0 24.50       retryDelay: 100,
#0 24.50       httpMethodsToRetry: [Array],
#0 24.50       noResponseRetries: 2,
#0 24.50       checkRetryAfter: true,
#0 24.50       maxRetryAfter: 300000,
#0 24.50       statusCodesToRetry: [Array]
#0 24.50     },
#0 24.50     method: 'get',
#0 24.50     withCredentials: true,
#0 24.50     url: '/store/collections?limit=100',
#0 24.50     json: true,
#0 24.50     data: undefined
#0 24.50   },
#0 24.50   request: <ref *1> Writable {
#0 24.50     _writableState: WritableState {
#0 24.50       objectMode: false,
#0 24.50       highWaterMark: 16384,
#0 24.50       finalCalled: false,
#0 24.50       needDrain: false,
#0 24.50       ending: false,
#0 24.50       ended: false,
#0 24.50       finished: false,
#0 24.50       destroyed: false,
#0 24.50       decodeStrings: true,
#0 24.50       defaultEncoding: 'utf8',
#0 24.50       length: 0,
#0 24.50       writing: false,
#0 24.50       corked: 0,
#0 24.50       sync: true,
#0 24.50       bufferProcessing: false,
#0 24.50       onwrite: [Function: bound onwrite],
#0 24.50       writecb: null,
#0 24.50       writelen: 0,
#0 24.50       afterWriteTickInfo: null,
#0 24.50       buffered: [],
#0 24.50       bufferedIndex: 0,
#0 24.50       allBuffers: true,
#0 24.50       allNoop: true,
#0 24.50       pendingcb: 0,
#0 24.50       constructed: true,
#0 24.50       prefinished: false,
#0 24.50       errorEmitted: false,
#0 24.50       emitClose: true,
#0 24.50       autoDestroy: true,
#0 24.50       errored: null,
#0 24.50       closed: false,
#0 24.50       closeEmitted: false,
#0 24.50       [Symbol(kOnFinished)]: []
#0 24.50     },
#0 24.50     _events: [Object: null prototype] {
#0 24.50       response: [Function: handleResponse],
#0 24.50       error: [Function: handleRequestError]
#0 24.50     },
#0 24.50     _eventsCount: 2,
#0 24.50     _maxListeners: undefined,
#0 24.50     _options: {
#0 24.50       maxRedirects: 21,
#0 24.50       maxBodyLength: 10485760,
#0 24.50       protocol: 'http:',
#0 24.50       path: '/store/collections?limit=100',
#0 24.50       method: 'GET',
#0 24.50       headers: [Object],
#0 24.50       agent: undefined,
#0 24.50       agents: [Object],
#0 24.50       auth: undefined,
#0 24.50       hostname: 'localhost',
#0 24.50       port: '9000',
#0 24.50       nativeProtocols: [Object],
#0 24.50       pathname: '/store/collections',
#0 24.50       search: '?limit=100'
#0 24.50     },
#0 24.50     _ended: true,
#0 24.50     _ending: true,
#0 24.50     _redirectCount: 0,
#0 24.50     _redirects: [],
#0 24.50     _requestBodyLength: 0,
#0 24.50     _requestBodyBuffers: [],
#0 24.50     _onNativeResponse: [Function (anonymous)],
#0 24.50     _currentRequest: ClientRequest {
#0 24.50       _events: [Object: null prototype],
#0 24.50       _eventsCount: 7,
#0 24.50       _maxListeners: undefined,
#0 24.50       outputData: [],
#0 24.50       outputSize: 0,
#0 24.50       writable: true,
#0 24.50       destroyed: false,
#0 24.50       _last: true,
#0 24.50       chunkedEncoding: false,
#0 24.50       shouldKeepAlive: false,
#0 24.50       maxRequestsOnConnectionReached: false,
#0 24.50       _defaultKeepAlive: true,
#0 24.50       useChunkedEncodingByDefault: false,
#0 24.50       sendDate: false,
#0 24.50       _removedConnection: false,
#0 24.50       _removedContLen: false,
#0 24.50       _removedTE: false,
#0 24.50       strictContentLength: false,
#0 24.50       _contentLength: 0,
#0 24.50       _hasBody: true,
#0 24.50       _trailer: '',
#0 24.50       finished: true,
#0 24.50       _headerSent: true,
#0 24.50       _closed: false,
#0 24.50       socket: [Socket],
#0 24.50       _header: 'GET /store/collections?limit=100 HTTP/1.1\r\n' +
#0 24.50         'Accept: application/json\r\n' +
#0 24.50         'Content-Type: application/json\r\n' +
#0 24.50         'User-Agent: axios/0.24.0\r\n' +
#0 24.50         'Host: localhost:9000\r\n' +
#0 24.50         'Connection: close\r\n' +
#0 24.50         '\r\n',
#0 24.50       _keepAliveTimeout: 0,
#0 24.50       _onPendingData: [Function: nop],
#0 24.50       agent: [Agent],
#0 24.50       socketPath: undefined,
#0 24.50       method: 'GET',
#0 24.50       maxHeaderSize: undefined,
#0 24.50       insecureHTTPParser: undefined,
#0 24.50       joinDuplicateHeaders: undefined,
#0 24.50       path: '/store/collections?limit=100',
#0 24.50       _ended: false,
#0 24.50       res: null,
#0 24.50       aborted: false,
#0 24.50       timeoutCb: null,
#0 24.50       upgradeOrConnect: false,
#0 24.50       parser: null,
#0 24.50       maxHeadersCount: null,
#0 24.50       reusedSocket: false,
#0 24.50       host: 'localhost',
#0 24.50       protocol: 'http:',
#0 24.50       _redirectable: [Circular *1],
#0 24.50       [Symbol(kCapture)]: false,
#0 24.50       [Symbol(kBytesWritten)]: 0,
#0 24.50       [Symbol(kEndCalled)]: true,
#0 24.50       [Symbol(kNeedDrain)]: false,
#0 24.50       [Symbol(corked)]: 0,
#0 24.50       [Symbol(kOutHeaders)]: [Object: null prototype],
#0 24.50       [Symbol(errored)]: null,
#0 24.50       [Symbol(kUniqueHeaders)]: null
#0 24.50     },
#0 24.50     _currentUrl: 'http://localhost:9000/store/collections?limit=100',
#0 24.50     [Symbol(kCapture)]: false
#0 24.50   },
#0 24.50   response: undefined,
#0 24.50   isAxiosError: true,
#0 24.50   toJSON: [Function: toJSON]
#0 24.50 }
#0 24.50
#0 24.50 > Build error occurred
#0 24.51 Error: Failed to collect page data for /collections/[id]
#0 24.51     at /app/storefront/node_modules/next/dist/build/utils.js:916:15
#0 24.51     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
#0 24.51   type: 'Error'
#0 24.51 }
#0 24.58 error Command failed with exit code 1.
#0 24.58 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Best regards,
Stéphane

Deployement to Cloudflare Pages failed!

Can anyone tell what is the reason for this error while deploying the storefront to cloudflare pages? Here are the build details and error logs, tried many times but failed! Thank You in Advance

Screenshot 2022-08-20 at 8 16 48 PM

2022-08-20T14:36:11.043323Z Cloning repository...
2022-08-20T14:36:12.680019Z From https://github.com/boloshabashe/super-shabashe-biz
2022-08-20T14:36:12.680565Z * branch 6706fe988bf32c1b19a0328eeb0c8a4f6b4aff17 -> FETCH_HEAD
2022-08-20T14:36:12.680763Z
2022-08-20T14:36:12.866196Z HEAD is now at 6706fe9 first commit
2022-08-20T14:36:12.86684Z
2022-08-20T14:36:13.010811Z
2022-08-20T14:36:13.036102Z Success: Finished cloning repository files
2022-08-20T14:36:13.706502Z Installing dependencies
2022-08-20T14:36:13.717246Z Python version set to 2.7
2022-08-20T14:36:16.953862Z Downloading and installing node v14.17.0...
2022-08-20T14:36:17.328861Z Downloading https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz...
2022-08-20T14:36:17.716657Z Computing checksum with sha256sum
2022-08-20T14:36:17.844118Z Checksums matched!
2022-08-20T14:36:22.206593Z Now using node v14.17.0 (npm v6.14.13)
2022-08-20T14:36:22.575579Z Started restoring cached build plugins
2022-08-20T14:36:22.588489Z Finished restoring cached build plugins
2022-08-20T14:36:23.066675Z Attempting ruby version 2.7.1, read from environment
2022-08-20T14:36:26.409337Z Using ruby version 2.7.1
2022-08-20T14:36:26.754431Z Using PHP version 5.6
2022-08-20T14:36:26.911273Z 5.2 is already installed.
2022-08-20T14:36:26.93684Z Using Swift version 5.2
2022-08-20T14:36:26.937317Z Started restoring cached node modules
2022-08-20T14:36:26.952447Z Finished restoring cached node modules
2022-08-20T14:36:26.959316Z Started restoring cached yarn cache
2022-08-20T14:36:26.973289Z Finished restoring cached yarn cache
2022-08-20T14:36:26.992654Z Installing yarn at version 1.22.4
2022-08-20T14:36:27.009577Z �[37mInstalling Yarn!�[0m
2022-08-20T14:36:27.009868Z �[36m> Downloading tarball...�[0m
2022-08-20T14:36:27.052881Z
2022-08-20T14:36:27.053228Z [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.2wyBb7x5N2
2022-08-20T14:36:27.053923Z % Total % Received % Xferd Average Speed Time Time Time Current
2022-08-20T14:36:27.054321Z Dload Upload Total Spent Left Speed
2022-08-20T14:36:27.295949Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 79 100 79 0 0 326 0 --:--:-- --:--:-- --:--:-- 326
2022-08-20T14:36:27.500907Z
100 93 100 93 0 0 207 0 --:--:-- --:--:-- --:--:-- 207
2022-08-20T14:36:27.664011Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2022-08-20T14:36:27.966982Z
0 1215k 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1215k 100 1215k 0 0 1331k 0 --:--:-- --:--:-- --:--:-- 10.4M
2022-08-20T14:36:27.967315Z
2022-08-20T14:36:27.967554Z [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.2wyBb7x5N2.asc
2022-08-20T14:36:28.01426Z
100 83 100 83 0 0 1791 0 --:--:-- --:--:-- --:--:-- 1791
2022-08-20T14:36:28.037653Z
100 97 100 97 0 0 1390 0 --:--:-- --:--:-- --:--:-- 1390
2022-08-20T14:36:28.047359Z
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2022-08-20T14:36:28.129096Z
100 1028 100 1028 0 0 6379 0 --:--:-- --:--:-- --:--:-- 6379
2022-08-20T14:36:28.177034Z �[36m> Verifying integrity...�[0m
2022-08-20T14:36:28.213763Z gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
2022-08-20T14:36:28.219901Z gpg: Good signature from "Yarn Packaging [email protected]"
2022-08-20T14:36:28.222343Z gpg: Note: This key has expired!
2022-08-20T14:36:28.22256Z Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
2022-08-20T14:36:28.222701Z Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
2022-08-20T14:36:28.223327Z �[32m> GPG signature looks good�[0m
2022-08-20T14:36:28.22351Z �[36m> Extracting to ~/.yarn...�[0m
2022-08-20T14:36:28.310555Z �[36m> Adding to $PATH...�[0m
2022-08-20T14:36:28.336459Z �[36m> We've added the following to your /opt/buildhome/.bashrc
2022-08-20T14:36:28.336782Z > If this isn't the profile of your current shell then please add the following to your correct profile:
2022-08-20T14:36:28.336954Z
2022-08-20T14:36:28.337075Z export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
2022-08-20T14:36:28.33719Z �[0m
2022-08-20T14:36:28.721151Z �[32m> Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.�[0m
2022-08-20T14:36:29.109949Z Installing NPM modules using Yarn version 1.22.4
2022-08-20T14:36:29.670107Z yarn install v1.22.4
2022-08-20T14:36:29.763537Z [1/4] Resolving packages...
2022-08-20T14:36:30.100182Z [2/4] Fetching packages...
2022-08-20T14:37:05.134462Z info [email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.135039Z info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.143236Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.143598Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.143784Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.143941Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.14408Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.144214Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.144373Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.144762Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.144963Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.145121Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.145281Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.145451Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.14562Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.145809Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.145983Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.146145Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.146318Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.146486Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.146702Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.146893Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.147045Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.147181Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.14733Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.147477Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.147613Z info @next/[email protected]: The CPU architecture "x64" is incompatible with this module.
2022-08-20T14:37:05.147788Z info @next/[email protected]: The platform "linux" is incompatible with this module.
2022-08-20T14:37:05.147944Z info "@next/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
2022-08-20T14:37:05.150842Z [3/4] Linking dependencies...
2022-08-20T14:37:05.154038Z warning " > @medusajs/[email protected]" has unmet peer dependency "[email protected]".
2022-08-20T14:37:05.154541Z warning " > @medusajs/[email protected]" has unmet peer dependency "[email protected]".
2022-08-20T14:37:05.154791Z warning "@medusajs/medusa > [email protected]" has unmet peer dependency "[email protected]".
2022-08-20T14:37:05.156263Z warning " > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
2022-08-20T14:37:05.156543Z warning "react-instantsearch-hooks-web > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
2022-08-20T14:37:05.156701Z warning "react-instantsearch-hooks-web > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
2022-08-20T14:37:05.157252Z warning "react-instantsearch-hooks-web > instantsearch.js > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
2022-08-20T14:37:25.02787Z [4/4] Building fresh packages...
2022-08-20T14:37:47.335999Z Done in 77.67s.
2022-08-20T14:37:47.368611Z NPM modules installed using Yarn
2022-08-20T14:37:47.666706Z Installing Hugo 0.54.0
2022-08-20T14:37:48.545366Z Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2022-08-20T14:37:48.549414Z Started restoring cached go cache
2022-08-20T14:37:48.568925Z Finished restoring cached go cache
2022-08-20T14:37:48.727215Z go version go1.14.4 linux/amd64
2022-08-20T14:37:48.743748Z go version go1.14.4 linux/amd64
2022-08-20T14:37:48.746083Z Installing missing commands
2022-08-20T14:37:48.746439Z Verify run directory
2022-08-20T14:37:48.746611Z Executing user command: yarn build
2022-08-20T14:37:48.996919Z yarn run v1.22.4
2022-08-20T14:37:49.036511Z $ next build
2022-08-20T14:37:49.621587Z next.config.js {
2022-08-20T14:37:49.622084Z "reactStrictMode": true,
2022-08-20T14:37:49.622473Z "images": {
2022-08-20T14:37:49.622692Z "domains": [
2022-08-20T14:37:49.622845Z "medusa-public-images.s3.eu-west-1.amazonaws.com",
2022-08-20T14:37:49.622964Z "localhost"
2022-08-20T14:37:49.623072Z ]
2022-08-20T14:37:49.623178Z },
2022-08-20T14:37:49.623289Z "env": {}
2022-08-20T14:37:49.623394Z }
2022-08-20T14:37:49.624998Z warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2022-08-20T14:37:49.68554Z Attention: Next.js now collects completely anonymous telemetry regarding usage.
2022-08-20T14:37:49.685843Z This information is used to shape Next.js' roadmap and prioritize features.
2022-08-20T14:37:49.686259Z You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
2022-08-20T14:37:49.68643Z https://nextjs.org/telemetry
2022-08-20T14:37:49.686566Z
2022-08-20T14:37:49.810722Z info - Linting and checking validity of types...
2022-08-20T14:38:00.425349Z info - Creating an optimized production build...
2022-08-20T14:38:21.756679Z info - Compiled successfully
2022-08-20T14:38:21.757028Z info - Collecting page data...
2022-08-20T14:38:28.64833Z
2022-08-20T14:38:28.648651Z > Build error occurred
2022-08-20T14:38:28.651068Z Error: connect ECONNREFUSED 127.0.0.1:9000
2022-08-20T14:38:28.651301Z at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
2022-08-20T14:38:28.651436Z type: 'Error',
2022-08-20T14:38:28.65156Z config: {
2022-08-20T14:38:28.651679Z transitional: {
2022-08-20T14:38:28.651815Z silentJSONParsing: true,
2022-08-20T14:38:28.651951Z forcedJSONParsing: true,
2022-08-20T14:38:28.652064Z clarifyTimeoutError: false
2022-08-20T14:38:28.652173Z },
2022-08-20T14:38:28.652287Z transformRequest: [ null ],
2022-08-20T14:38:28.652402Z transformResponse: [ null ],
2022-08-20T14:38:28.652511Z timeout: 0,
2022-08-20T14:38:28.652619Z xsrfCookieName: 'XSRF-TOKEN',
2022-08-20T14:38:28.652745Z xsrfHeaderName: 'X-XSRF-TOKEN',
2022-08-20T14:38:28.652884Z maxContentLength: -1,
2022-08-20T14:38:28.652997Z maxBodyLength: -1,
2022-08-20T14:38:28.653111Z headers: {
2022-08-20T14:38:28.653237Z Accept: 'application/json',
2022-08-20T14:38:28.653352Z 'Content-Type': 'application/json',
2022-08-20T14:38:28.653475Z 'User-Agent': 'axios/0.24.0'
2022-08-20T14:38:28.653608Z },
2022-08-20T14:38:28.653748Z baseURL: 'http://localhost:9000',
2022-08-20T14:38:28.653888Z raxConfig: {
2022-08-20T14:38:28.65401Z retry: 3,
2022-08-20T14:38:28.654136Z backoffType: 'exponential',
2022-08-20T14:38:28.65428Z currentRetryAttempt: 3,
2022-08-20T14:38:28.654403Z retryDelay: 100,
2022-08-20T14:38:28.654531Z httpMethodsToRetry: [Array],
2022-08-20T14:38:28.654652Z noResponseRetries: 2,
2022-08-20T14:38:28.654777Z checkRetryAfter: true,
2022-08-20T14:38:28.654911Z maxRetryAfter: 300000,
2022-08-20T14:38:28.655028Z statusCodesToRetry: [Array]
2022-08-20T14:38:28.655154Z },
2022-08-20T14:38:28.655275Z method: 'get',
2022-08-20T14:38:28.655402Z withCredentials: true,
2022-08-20T14:38:28.655516Z url: '/store/collections?limit=100',
2022-08-20T14:38:28.655629Z json: true
2022-08-20T14:38:28.65575Z },
2022-08-20T14:38:28.655872Z code: 'ECONNREFUSED',
2022-08-20T14:38:28.656036Z status: null
2022-08-20T14:38:28.656162Z }
2022-08-20T14:38:28.695944Z error Command failed with exit code 1.
2022-08-20T14:38:28.696227Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2022-08-20T14:38:28.708669Z Failed: build command exited with code: 1
2022-08-20T14:38:29.60971Z Failed: an internal error occurred

Having an issue after payment using stripe

After processing the checkout the app is crashing

Capture d’écran 2022-12-19 à 01 48 08

error - src/modules/order/components/payment-details/index.tsx (45:36) @ StripeDetails
error - TypeError: Cannot read properties of undefined (reading 'data')
    at StripeDetails (webpack-internal:///./src/modules/order/components/payment-details/index.tsx:86:39)
    at processChild (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
    at resolve (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
    at Object.renderToString (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27)
    at Object.renderPage (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected]_oh345hcsaunslvozv24xisnbli/node_modules/next/dist/server/render.js:680:46)
    at Object.defaultGetInitialProps (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected]_oh345hcsaunslvozv24xisnbli/node_modules/next/dist/server/render.js:350:67)
    at Function.getInitialProps (webpack-internal:///./node_modules/.pnpm/[email protected]_oh345hcsaunslvozv24xisnbli/node_modules/next/dist/pages/_document.js:19:20)
    at Object.<anonymous> (/Users/matteogauthier/dev/nearby-rental-store/storefront/node_modules/.pnpm/[email protected]_oh345hcsaunslvozv24xisnbli/node_modules/next/dist/shared/lib/utils.js:75:33) {
  page: '/order/confirmed/[id]'
}
  43 |     exp_year: number
  44 |     exp_month: number
> 45 |   } = (payment.data.charges as any).data[0].payment_method_details.card
     |                                    ^
  46 | 
  47 |   return (
  48 |     <div className="flex flex-col text-base-regular">

Deploy NextJs Storefront using Docker Run

Hello folks,

The Nextjs uses SSG for most pages and we need a backend server running in build time. So how we can build an image and can use it in both development and production environments. They have different backend server URL and we only know about the backend server at run time, when we run docker run -e NEXT_PUBLIC_MEDUSA_BACKEND_URL=backend-dev.host.com or docker run -e NEXT_PUBLIC_MEDUSA_BACKEND_URL=backend-prod.host.com

TypeError: Cannot read properties of undefined (reading 'map') product/[id].js

Hi, I followed the instruction from nextjs-medusa-starter but get the following error when I build the web app.

> Build error occurred
TypeError: Cannot read properties of undefined (reading 'map')
    at getStaticPaths (/mnt/c/Users/Project/Medusa/nextjs/Medusa-nextJS/.next/server/pages/product/[id].js:228:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async buildStaticPaths (/mnt/c/Users/Project/Medusa/nextjs/Medusa-nextJS/node_modules/next/dist/build/utils.js:497:31)
    at async /mnt/c/Users/Project/Medusa/nextjs/Medusa-nextJS/node_modules/next/dist/build/utils.js:640:119
    at async Span.traceAsyncFn (/mnt/c/Users//Project/Medusa/nextjs/Medusa-nextJS/node_modules/next/dist/trace/trace.js:75:20) {
  type: 'TypeError'
}

Im running Medusa server on localhost:9000 and is configured the same in .env.local as well

✔ Indexing completed – 19ms
✔ Server is ready on port: 9000 – 7ms
::1 - - [19/Mar/2022:07:40:21 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "curl/7.79.1"
::1 - - [19/Mar/2022:07:40:55 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "PostmanRuntime/7.3.0"
::ffff:127.0.0.1 - - [19/Mar/2022:07:47:04 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::ffff:127.0.0.1 - - [19/Mar/2022:07:49:55 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::ffff:127.0.0.1 - - [19/Mar/2022:07:51:38 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::ffff:127.0.0.1 - - [19/Mar/2022:07:53:45 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::ffff:127.0.0.1 - - [19/Mar/2022:07:57:54 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::ffff:127.0.0.1 - - [19/Mar/2022:07:58:35 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::1 - - [19/Mar/2022:08:00:40 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "PostmanRuntime/7.3.0"
::ffff:127.0.0.1 - - [19/Mar/2022:08:00:48 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"
::ffff:127.0.0.1 - - [19/Mar/2022:08:00:52 +0000] "GET /store/products HTTP/1.1" 200 59826 "-" "axios/0.21.4"

Invalid next.config.js options detected

1 - run yarn create medusa-app
2 - cd into /my-medusa-store/storefront
3 - yarn start as instructed
4 - following error received

image

`yarn run v1.22.19
$ next start -p 8000
ready - started server on 0.0.0.0:8000, url: http://localhost:8000
next.config.js {
"features": {
"search": false
},
"reactStrictMode": true,
"images": {
"domains": [
"medusa-public-images.s3.eu-west-1.amazonaws.com",
"localhost"
]
},
"env": {}
}
warn - Invalid next.config.js options detected:

  • The root value has an unexpected property, features, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).

See more info here: https://nextjs.org/docs/messages/invalid-next-config
Error: Could not find a production build in the '/home/prasit/Documents/praxio/my-medusa-store/storefront/.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at NextNodeServer.getBuildId (/home/prasit/Documents/praxio/my-medusa-store/storefront/node_modules/next/dist/server/next-server.js:115:23)
at new Server (/home/prasit/Documents/praxio/my-medusa-store/storefront/node_modules/next/dist/server/base-server.js:70:29)
at new NextNodeServer (/home/prasit/Documents/praxio/my-medusa-store/storefront/node_modules/next/dist/server/next-server.js:62:9)
at NextServer.createServer (/home/prasit/Documents/praxio/my-medusa-store/storefront/node_modules/next/dist/server/next.js:128:16)
at async /home/prasit/Documents/praxio/my-medusa-store/storefront/node_modules/next/dist/server/next.js:137:31
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`

CAN WE HAVE PAYMENT INTEGRATION FOR PAYSTACK OR FLUTTERWAVE

I love Medusa but I am from Nigeria where Stripe and other services are not easily supported,
you need to register your company in the US to use Stripe,
Paystack and Flutterwave are the biggest payment system in Nigeria and Africa
and integrating with these two system would mean MEDUSA is easy to use in Africa.

Unable to clone and install medusa starter due to sqlite3 version

I am not sure if someone else ran into this issue but for me It's not possible to simple create a new storefront following medusa documentation. After a short investigation (my current node version is 19) you need to use node18 or below. In order to use this template sqlite3 version needs to be upgraded at least to v5.0.3.

Modal content hidden.

Modal content hidden with no scroll when adding a new address on smaller screens.

image

NextJS 13 SSR/ISR support

With the release of NextJS 13, it is now more convenient to fetch store data from server using React Server Component.
I tried migrating and managed to get part of products/[slug] rendered on the server. Haven't done the benchmark but in theory it should be faster 😄
I see that package medusa-react is stateful and supposed to be used in client. I wonder if I could skip medusa-react and only use medusa-js to fetch store data on the server. Is there anybody tried to do the same, can you share your experience?

netlify deployment error

After clicking the button to deploy in netlify, configure the URL of my backend and deploy, I get this error during the build

Error starting Store front. ReferenceError: window is not defined

I have tried to run yarn dev on Node 14, 16, and 18 but I get the same error.

ReferenceError: window is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.

All the time in the following path.

storefront/node_modules/@medusajs/medusa-js/dist/index.js:1:93559

if I go to the file mentioned above and remove the line of code where the window object is used, the store loads and works but, then I got a new error in the product details page related to the XHTTP..... (this shouldn't be the way to fix this)

Any idea about this?

Error in Stripe Payment

If the admin has a payment method other than stripe (for example, manual), an error occurs here:

const payload = await stripe.confirmCardPayment(
cart.payment_session.data.client_secret,
{
payment_method: {
card: elements.getElement(CardElement),
},
}
);

This is because payment_session is not part of the received data in the cart from the request /store/carts/{id}/payment-sessions

yarn build require connect to Medusa Backend

Hi all,

I want to deploy storefront next js version in production, but when I try to build by yarn run build to make generates an optimized version of the application for production, but I get the error message connect ECONNREFUSED 127.0.0.1:9000. The full stack trace is below. I understand that the issue is that the storefront can't connect to the backend server, but my question is, why in the build phase do we need to send requests to the backend server. As I understand, the build parse only compiles source code to javascript files. Please correct me if I am wrong. Thank you very much.

info  - Linting and checking validity of types
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
info  - Creating an optimized production build
info  - Compiled successfully
info  - Collecting page data ...(node:129673) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

> Build error occurred
Error: connect ECONNREFUSED 127.0.0.1:9000
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1195:16) {
  type: 'Error',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    transformRequest: [ null ],
    transformResponse: [ null ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.24.0'
    },
    baseURL: 'http://localhost:9000',
    raxConfig: {
      retry: -1,
      backoffType: 'exponential',
      currentRetryAttempt: 0,
      retryDelay: 100,
      httpMethodsToRetry: [Array],
      noResponseRetries: 2,
      checkRetryAfter: true,
      maxRetryAfter: 300000,
      statusCodesToRetry: [Array]
    },
    method: 'get',
    withCredentials: true,
    url: '/store/collections?limit=100',
    json: true
  },
  code: 'ECONNREFUSED',
  status: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.````

Impossible to login

Hello,
I pulled and installed this project in my local, but I can't to log in with my account, I had always a redirection to page login knowing that I received the server response,according to the following capture :

qqq

node : v16.15.0
windows 10

Thank you for your help

Request for GDPR Notification Feature in Next.js Starter Medusa

As many of you may already know, hosting a website in the EU requires the provision of a GDPR notification that users must accept when their information is being collected. However, upon my initial exploration of the nextjs-starter-medusa project, I could not find any such option.

Considering this, I propose the addition of a plugin, feature, or option to incorporate a GDPR notification specifically tailored for EU e-commerce shops.

This enhancement would ensure compliance with GDPR regulations and provide a more comprehensive solution for users of Next.js Starter Medusa. Thank you for considering this request, and I look forward to your feedback and contributions to implement this feature.

just create new medusa project and it doesnt work

input:

C:>cd c:\vajnoe\medusa_app\ura\my-shop\storefront

c:\vajnoe\medusa_app\ura\my-shop\storefront>npm run start

output:

[email protected] start
next start -p 8000

warn - Invalid casing detected for project dir, received c:\vajnoe\medusa_app\ura\my-shop\storefront actual path C:\vajnoe\medusa_app\ura\my-shop\storefront, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing
ready - started server on 0.0.0.0:8000, url: http://localhost:8000
next.config.js {
"reactStrictMode": true,
"images": {
"domains": [
"medusa-public-images.s3.eu-west-1.amazonaws.com",
"localhost"
]
},
"env": {}
}
Error: Could not find a production build in the 'C:\vajnoe\medusa_app\ura\my-shop\storefront.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at NextNodeServer.getBuildId (c:\vajnoe\medusa_app\ura\my-shop\storefront\node_modules\next\dist\server\next-server.js:169:23)
at new Server (c:\vajnoe\medusa_app\ura\my-shop\storefront\node_modules\next\dist\server\base-server.js:58:29)
at new NextNodeServer (c:\vajnoe\medusa_app\ura\my-shop\storefront\node_modules\next\dist\server\next-server.js:70:9)
at NextServer.createServer (c:\vajnoe\medusa_app\ura\my-shop\storefront\node_modules\next\dist\server\next.js:140:16)
at async c:\vajnoe\medusa_app\ura\my-shop\storefront\node_modules\next\dist\server\next.js:149:31

c:\vajnoe\medusa_app\ura\my-shop\storefront>next build
warn - Invalid casing detected for project dir, received c:\vajnoe\medusa_app\ura\my-shop\storefront actual path C:\vajnoe\medusa_app\ura\my-shop\storefront, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing
next.config.js {
"reactStrictMode": true,
"images": {
"domains": [
"medusa-public-images.s3.eu-west-1.amazonaws.com",
"localhost"
]
},
"env": {}
}
info - Linting and checking validity of types
info - Creating an optimized production build
info - Compiled successfully
unhandledRejection Error: Cannot find module 'next/dist/shared/lib/router/utils/is-local-url.js'
Require stack:

  • C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\pages_app.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\require.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\load-components.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\export\worker.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\build\worker.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\compiled\jest-worker\processChild.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at mod._resolveFilename (C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\build\webpack\require-hook.js:23:32)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at 1109 (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\pages_app.js:209:18)
    at webpack_require (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\webpack-runtime.js:25:42)
    at 7760 (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\chunks\712.js:1188:19)
    at webpack_require (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\webpack-runtime.js:25:42)
    at 2841 (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\chunks\712.js:662:40) {
    type: 'Error',
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\vajnoe\medusa_app\ura\my-shop\storefront\.next\server\pages\_app.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\require.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\load-components.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\export\worker.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\build\worker.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\compiled\jest-worker\processChild.js'
    ]
    }
    info - Collecting page data .
    c:\vajnoe\medusa_app\ura\my-shop\storefront>next build
    warn - Invalid casing detected for project dir, received c:\vajnoe\medusa_app\ura\my-shop\storefront actual path C:\vajnoe\medusa_app\ura\my-shop\storefront, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing
    next.config.js {
    "reactStrictMode": true,
    "images": {
    "domains": [
    "medusa-public-images.s3.eu-west-1.amazonaws.com",
    "localhost"
    ]
    },
    "env": {}
    }
    info - Linting and checking validity of types
    info - Creating an optimized production build
    info - Compiled successfully
    unhandledRejection Error: Cannot find module 'next/dist/shared/lib/router/utils/is-local-url.js'
    Require stack:
  • C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\pages_app.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\require.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\load-components.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\export\worker.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\build\worker.js
  • C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\compiled\jest-worker\processChild.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at mod._resolveFilename (C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\build\webpack\require-hook.js:23:32)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at 1109 (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\pages_app.js:209:18)
    at webpack_require (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\webpack-runtime.js:25:42)
    at 7760 (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\chunks\712.js:1188:19)
    at webpack_require (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\webpack-runtime.js:25:42)
    at 2841 (C:\vajnoe\medusa_app\ura\my-shop\storefront.next\server\chunks\712.js:662:40) {
    type: 'Error',
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\vajnoe\medusa_app\ura\my-shop\storefront\.next\server\pages\_app.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\require.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\server\load-components.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\export\worker.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\build\worker.js',
    'C:\Users\Константин\AppData\Roaming\npm\node_modules\next\dist\compiled\jest-worker\processChild.js'
    ]
    }
    info - Collecting page data .

Breadcrumb component

It would be nice if the template had a breadcrumb component for the collection+product pages.

Bug: Shipping details are cleared/erased when auth route is queried at checkout

I have consistently been able to reproduce this bug, it appears that the checkout provider is recreated when the user auth session is queried (see video below)

  1. Clear cookies/session data
  2. Add an item to bag
  3. go to checkout page
  4. begin filling out form
  5. when auth is queried, the form is erased

I am guessing that when the checkout provider is recreated, the entire <CheckoutForm> component is remounted, causing the data loss.

No workaround at the moment

Screen.Recording.2023-05-27.at.3.28.16.PM.mov

i18n Support

Hi there,

I was wondering if you have any plans to support i18n or any multi-language feature in your project's roadmap?

I understand that there are various i18n packages available, but since I have forked this project and added customized features, it would be difficult to merge with your new features in the future. Therefore, it would be greatly appreciated if you could consider adding i18n support to make the integration process easier.

For this Next.js project, perhaps the next-i18next package could be used to achieve this goal.

For example:

import { useTranslation } from 'next-i18next'

export const Footer = () => {
  const { t } = useTranslation('footer')

  return (
    <footer>
      <p>{t('description')}</p>
    </footer>
  )
}

Thank you for your consideration!

Can't find Python executable "python" during yarn install

Hi community! While installing the packages, the process stops during the sqlite3 step. Due to I didn't have python installed

yarn install v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > @medusajs/[email protected]" has unmet peer dependency "[email protected]".
warning " > @medusajs/[email protected]" has unmet peer dependency "[email protected]".
warning "@medusajs/medusa > [email protected]" has unmet peer dependency "[email protected]".
warning " > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning "react-instantsearch-hooks-web > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning "react-instantsearch-hooks-web > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning "react-instantsearch-hooks-web > instantsearch.js > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
[4/4] 🔨  Building fresh packages...
[-/7] ⠠ waiting...
[6/7] ⠠ cypress
[-/7] ⠠ waiting...
[4/7] ⠠ sqlite3
error /Users/bob/nextjs-starter-medusa/node_modules/sqlite3: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /Users/bob/nextjs-starter-medusa/node_modules/sqlite3
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node" (not found)
node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz
node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/Users/bob/nextjs-starter-medusa/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/bob/nextjs-starter-medusa/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/Users/bob/nextjs-starter-medusa/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/Users/bob/nextjs-starter-medusa/node_modules/which/which.js:80:29)
gyp ERR! stack     at /Users/bob/nextjs-starter-medusa/node_modules/which/which.js:89:16
gyp ERR! stack     at /Users/bob/nextjs-starter-medusa/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /Users/bob/nextjs-starter-medusa/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:206:21)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/bob/nextjs-starter-medusa/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /Users/bob/nextjs-starter-medusa/node_modules/sqlite3
gyp ERR! node -v v16.17.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /Users/bob/nextjs-starter-medusa/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/bob/nextjs-starter-medusa/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1093:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Darwin 21.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/bob/nextjs-starter-medusa/node_modules/sqlite3
node-pre-gyp ERR! node -v v16.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /Users/bob/nextjs-starter-medusa/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/bob/nextjs-starter-medusa/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64 --napi_version=8 --node_abi_

Not running

Got error when first visit store front
image

Detail log

> [email protected] dev
> next dev -p 8000

ready - started server on 0.0.0.0:8000, url: http://localhost:8000
info  - Loaded env from /Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/.env.local
next.config.js {
  "reactStrictMode": true,
  "images": {
    "domains": [
      "medusa-public-images.s3.eu-west-1.amazonaws.com",
      "localhost"
    ]
  },
  "env": {}
}
event - compiled client and server successfully in 2.1s (337 modules)
wait  - compiling...
event - compiled successfully in 241 ms (296 modules)
wait  - compiling /404 (client and server)...
event - compiled client and server successfully in 827 ms (937 modules)
Error: No QueryClient set, use QueryClientProvider to set one
    at Object.useQueryClient (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/@tanstack/react-query/build/lib/QueryClientProvider.js:58:11)
    at useHydrate (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/@tanstack/react-query/build/lib/Hydrate.js:30:43)
    at Hydrate (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/@tanstack/react-query/build/lib/Hydrate.js:50:3)
    at processChild (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
    at resolve (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
    at Object.renderToString (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27)
    at Object.renderPage (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/next/dist/server/render.js:680:46)
    at Object.defaultGetInitialProps (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/next/dist/server/render.js:350:67)
wait  - compiling /_error (client and server)...
event - compiled client and server successfully in 149 ms (938 modules)
warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
Error: Failed to fetch update manifest Internal Server Error
    at http://localhost:8000/_next/static/chunks/webpack.js?ts=1676004297111:1218:37
wait  - compiling / (client and server)...
event - compiled client and server successfully in 515 ms (945 modules)
error - Error: No QueryClient set, use QueryClientProvider to set one
    at Object.useQueryClient (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/@tanstack/react-query/build/lib/QueryClientProvider.js:58:11)
    at useHydrate (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/@tanstack/react-query/build/lib/Hydrate.js:30:43)
    at Hydrate (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/@tanstack/react-query/build/lib/Hydrate.js:50:3)
    at processChild (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
    at resolve (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
    at Object.renderToString (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27)
    at Object.renderPage (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/next/dist/server/render.js:680:46)
    at Object.defaultGetInitialProps (/Users/xxx/xxx/xxx/medusajs/medusa-store/storefront/node_modules/next/dist/server/render.js:350:67) {
  page: '/'
}

slowly navigate to produts

i had an issue and declared it in isuues section as a bug
my main issue was
slowly navigate to produts like 2 seconde to navigte
and carts section doesn't work well!

4 request has been made for navigation to a product and that's a lot
Screenshot 2023-06-18 115002

cart isn't working probably
Screenshot 2023-06-18 115752

401 status code for every navigate sometimes happens and sometimes not !
Screenshot 2023-06-18 115849

i'm working on
windows 10
latest node version
latest project version

Cart is persistent across different user login/logout, tough sharing pricing/voucher

Bug report

Describe the bug

1)I login with a user i add product to my cart . I may or may not apply a voucher-discount or even add a price list.

  1. i logout or switch user

  2. i still have the cart with the voucher/pricelist(bypassing the pricelist restriction)

Additional context

Expected behavior

If i logout, or switch user my cart should be different and link to that user especially if pricing or voucher where used.

Unhandled Runtime Error

I was trying out the nextjs-starter and I have been running into this error when I start the development server with yarn dev. There doesn't seem to be any error in the console.

This is the output:

ready - started server on 0.0.0.0:8000, url: http://localhost:8000
info  - Loaded env from C:\Users\Acer\Desktop\Development\blogs-tut\medusa\my-medusa-storefront\.env.local
next.config.js {
  "reactStrictMode": true,
  "images": {
    "domains": [
      "medusa-public-images.s3.eu-west-1.amazonaws.com",
      "localhost"
    ]
  },
  "env": {}
}
event - compiled client and server successfully in 43.3s (1054 modules)
wait  - compiling...
event - compiled successfully in 442 ms (1011 modules)
wait  - compiling / (client and server)...
event - compiled client and server successfully in 5.9s (1645 modules)

But the problem is when I go to localhost:8000 to check it, this is the error I get:

MIT license missing

Problem: There is no LICENSE file in this repository.
Context: Since README.md states that this repository is licensed under the MIT license, as well as many are using create-next-app using the template of this repo to create the initial commit in their project.
Question: Is this repo MIT licensed? Or a hidden vendor lock-in trick?
Solution: adding the LICENSE file will bring transparency which is important to Medusa users.

Error A component is changing from uncontrolled to controlled.

next-dev.js:28 A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.
at eval (webpack-internal:///./node_modules/@headlessui/react/dist/components/listbox/listbox.js:28:3470)
at div
at CountrySelect (webpack-internal:///./src/modules/layout/components/country-select/index.tsx:22:83)
at div
at div
at div
at FooterNav (webpack-internal:///./src/modules/layout/components/footer-nav/index.tsx:18:83)
at footer
at Footer
at div
at Layout (webpack-internal:///./src/modules/layout/templates/index.tsx:14:26)
at AccountProvider (webpack-internal:///./src/lib/context/account-context.tsx:35:26)
at StoreProvider (webpack-internal:///./src/lib/context/store-context.tsx:40:26)
at CartProvider (webpack-internal:///./node_modules/medusa-react/dist/medusa-react.esm.js:1886:23)
at MobileMenuProvider (webpack-internal:///./src/lib/context/mobile-menu-context.tsx:23:26)
at CartDropdownProvider (webpack-internal:///./src/lib/context/cart-dropdown-context.tsx:19:26)
at Hydrate (webpack-internal:///./node_modules/@tanstack/react-query/build/lib/Hydrate.js:46:3)
at QueryClientProvider (webpack-internal:///./node_modules/@tanstack/react-query/build/lib/QueryClientProvider.js:64:3)
at MedusaProvider (webpack-internal:///./node_modules/medusa-react/dist/medusa-react.esm.js:758:39)
at App (webpack-internal:///./src/pages/_app.tsx:26:27)
at ErrorBoundary (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:8:20742)
at ReactDevOverlay (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:8:23635)
at Container (webpack-internal:///./node_modules/next/dist/client/index.js:70:9)
at AppContainer (webpack-internal:///./node_modules/next/dist/client/index.js:216:26)
at Root (webpack-internal:///./node_modules/next/dist/client/index.js:403:27)

Negative stock Product make cart page crash

I got a product with allowBAckorder to Yes but with a negative stock.
In frontend i can add to cart and basket(menu) is working all good.

But once i click go to cart ERROR, i know its about the qty because if i put 10 instead of minus 1 i can reach the cart page.

i attached screenshot of setting and error

Screenshot 2022-07-14 at 10 29 41 PM

Screenshot 2022-07-14 at 10 29 50 PM

The price conversion produces NA when I change my region to Nigeria in the Storefront

When I select my shipping region in the Storefront, the price of products would normally be updated to reflect the equivalent in that region's currency.

When I select Nigeria as my region, the conversion gives an output of NGN NA.

Note: I've already registered Nigeria as a region on my admin dashboard, I've also registered the Nigerian Naira as a currency.

Product pages does not load - stuck on pending

I installed the starter and most pages work correctly, except for the product page.
When navigating to a product page (either by clicking a product in the collections page, or pasting the url into the address bar) the document is stuck on pending in the network tab, with the following url: http://localhost:8333/_next/data/development/products/sweatshirt.json?handle=sweatshirt

image

I tried to change ports, restarted the server, Chrome and Safari, cleared cache, and more. Nothing worked :(
Also might be worth mentioning that on Firefox all API requests are stuck in a weird state, seems like they are not even pending. I'm not sure it's related, as other browsers are working mostly fine. Attaching screenshot:
image

Environment details:
Mac Mojave 10.14.6
Running backend on Docker
Storefront on host machine with `yarn dev`
Project generated from this template yesterday
Node v16.17.0
Yarn 1.22.19

Error: read ECONNRESET on product page

wait - compiling...
event - compiled client and server successfully in 457 ms (1516 modules)
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
wait - compiling /products/[handle] (client and server)...
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
event - compiled client and server successfully in 217 ms (1673 modules)
wait - compiling /_error (client and server)...
event - compiled client and server successfully in 109 ms (1673 modules)
error - Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:220:20) {
type: 'Error',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
transformRequest: [ null ],
transformResponse: [ null ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.24.0'
},
baseURL: 'http://localhost:9000',
raxConfig: {
retry: 3,
backoffType: 'exponential',
currentRetryAttempt: 3,
retryDelay: 100,
httpMethodsToRetry: [Array],
noResponseRetries: 2,
checkRetryAfter: true,
maxRetryAfter: 300000,
statusCodesToRetry: [Array]
},
method: 'get',
withCredentials: true,
url: '/store/products?limit=25',
json: true
},
code: 'ECONNRESET',
status: null,
page: '/products/[handle]'
}
error - Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:220:20) {
type: 'Error',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
transformRequest: [ null ],
transformResponse: [ null ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.24.0'
},
baseURL: 'http://localhost:9000',
raxConfig: {
retry: 3,
backoffType: 'exponential',
currentRetryAttempt: 3,
retryDelay: 100,
httpMethodsToRetry: [Array],
noResponseRetries: 2,
checkRetryAfter: true,
maxRetryAfter: 300000,
statusCodesToRetry: [Array]
},
method: 'get',
withCredentials: true,
url: '/store/products?limit=25',
json: true
},
code: 'ECONNRESET',
status: null,
page: '/products/[handle]'
}

Multiple errors encountered when trying to start development server

When you run yarn dev or npm run dev, the app claims to build successfully. Once you try to access it on local host, it returns several errors including "There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.