GithubHelp home page GithubHelp logo

builderio / nextjs-shopify Goto Github PK

View Code? Open in Web Editor NEW
424.0 14.0 207.0 4.22 MB

The ultimate starter for headless Shopify stores

Home Page: https://headless.builders

License: MIT License

CSS 1.04% TypeScript 97.67% JavaScript 1.29%
nextjs-starter nextjs react drag-and-drop headless

nextjs-shopify's Introduction

Next.js + Shopify + Builder.io example

Demo live at: headless.builders

Goals and Features

  • Ultra high performance
  • SEO optimized
  • Themable
  • Personalizable (internationalization, a/b testing, etc)
  • Builder.io Visual CMS integrated

Video walkthrough

Learn how to get started with this Builder + Next.js + Shopify example with this step by step video guide here:

Table of contents

Getting Started

Pre-requisites

This guide will assume that you have the following software installed:

  • nodejs (>=12.0.0)
  • npm
  • git

You should already have a Shopify account and store created before starting as well.

Introduction

After following this guide you will have

  • A Next.js app, ready to deploy to a hosting provider of your choice
  • Pulling live collection and product information from Shopify
  • Powered by the Builder.io visual CMS

1: Create an account for Builder.io

Before we start, head over to Builder.io and create an account.

2: Your Builder.io private key

Head over to your organization settings page and create a private key, copy the key for the next step.

organizations drop down list

  • Click "Account" from the left hand sidebar
  • Click the edit icon for the "Private keys" row
  • Copy the value of the auto-generated key, or create a new one with a name that's meaningful to you

Example of how to get your private key

3: Clone this repository and initialize a Builder.io space

Next, we'll create a copy of the starter project, and create a new space for it's content to live in.

In the example below, replace <private-key> with the key you copied in the previous step, and change <space-name> to something that's meaningful to you -- don't worry, you can change it later!

git clone https://github.com/BuilderIO/nextjs-shopify.git
cd nextjs-shopify

unzip builder

npm install --global "@builder.io/cli"

builder create --key "<private-key>" --name "<space-name>" --debug

Note: if you're only interested in using this starter for a landing page with Shopify use this command instead:

unzip builder-landing-page-only
builder create --key "<private-key>" --name "<space-name>" --input builder-landing-page-only --debug

If this was a success you should be greeted with a message that includes a public API key for your newly minted Builder.io space.

Note: This command will also publish some starter builder.io cms content from the ./builder directory to your new space when it's created.

  ____            _   _       _                     _                    _   _
| __ )   _   _  (_) | |   __| |   ___   _ __      (_)   ___       ___  | | (_)
|  _ \  | | | | | | | |  / _` |  / _ \ | '__|     | |  / _ \     / __| | | | |
| |_) | | |_| | | | | | | (_| | |  __/ | |     _  | | | (_) |   | (__  | | | |
|____/   \__,_| |_| |_|  \__,_|  \___| |_|    (_) |_|  \___/     \___| |_| |_|

|████████████████████████████████████████| shopify-product | 0/0
|████████████████████████████████████████| product-page: writing generic-template.json | 1/1
|████████████████████████████████████████| shopify-collection | 0/0
|████████████████████████████████████████| collection-page: writing generic-collection.json | 1/1
|████████████████████████████████████████| page: writing homepage.json | 2/2


Your new space "next.js shopify starter" public API Key: 012345abcdef0123456789abcdef0123

Copy the public API key ("012345abcdef0123456789abcdef0123" in the example above) for the next step.

This starter project uses dotenv files to configure environment variables. Open the files .env.development and .env.production in your favorite text editor, and set the value of BUILDER_PUBLIC_KEY to the public key you just copied. You can ignore the other variables for now, we'll set them later.

+ BUILDER_PUBLIC_KEY=012345abcdef0123456789abcdef0123
- BUILDER_PUBLIC_KEY=
SHOPIFY_STOREFRONT_API_TOKEN=
SHOPIFY_STORE_DOMAIN=

4. Shopify Custom App

Create a custom app for your Shopify store. If you don't have a Shopify store already, you can create a development store.

When creating the private app you'll have to set a number of permissions so that builder can retrieve your Shopify inventory. For this press on Storefront API in the configuration tab and choose all the following permissions:

List of required permissions

Then in the API Credentials tab, click install:

installing custom app

And copy the generated access token.

5. Connecting Builder to Shopify

Access your newly created space by selecting it from the list of spaces in your organization.

You should be greeted by a modal asking for various your storefront Access toke (from preview step) and your store domain, this will allow Builder.io to communicate with your store API:

Example of where the Shopify API keys map to Builder settings

Fill in the required keys and press "Connect your Shopify Custom App"!

6. Configure the project to talk to Shopify

Open up .env.development and .env.production again, but this time set the other two Shopify keys.

BUILDER_PUBLIC_KEY=012345abcdef0123456789abcdef0123
+ SHOPIFY_STOREFRONT_API_TOKEN=c11b4053408085753bd76a45806f80dd
- SHOPIFY_STOREFRONT_API_TOKEN=
+ SHOPIFY_STORE_DOMAIN=dylanbuilder.myshopify.com
- SHOPIFY_STORE_DOMAIN=

7. Up and Running!

The hard part is over, all you have to do is start up the project now.

npm install
npm run dev

This will start a server at http://localhost:3000.

8. Start building

Now that we have everything setup, start building and publishing pages on builder.io, for a demo on building something similar to the demo homepage, follow the steps in this short video

Deployment Options

You can deploy this code anywhere you like - you can find many deployment options for Next.js here. The following options support one click installs and are super easy to start with:

Deploy with Vercel

Deploy to Netlify

nextjs-shopify's People

Contributors

bntzio avatar dependabot[bot] avatar dkendal avatar ebenkb avatar eliamartani avatar fgiuliani avatar francam94 avatar ftonato avatar gustavocodess avatar jivewise avatar jtang0506 avatar julianbenegas avatar leahtard avatar leerob avatar lfades avatar lucleray avatar marbiano avatar matiasperz avatar nico-bachner avatar okbel avatar ollyswanson avatar pacocoursey avatar renanfeluck avatar ricardolmsilva avatar ricardosilvacode avatar steve8708 avatar teleaziz avatar timneutkens avatar willianjusten avatar xavierdupuis 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

nextjs-shopify's Issues

Package subpath './lib/parser' is not defined by "exports (poscss)

Running node 18.12.1 (npm 8.19.2)

Getting the following error when running npm run dev

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in C:\projects\sitecore-ladybug\node_modules\postcss\package.json
    at new NodeError (node:internal/errors:393:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:358:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:668:3)
    at resolveExports (node:internal/modules/cjs/loader:529:36)
    at Module._findPath (node:internal/modules/cjs/loader:569:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:981:27)
    at mod._resolveFilename (C:\projects\sitecore-ladybug\node_modules\next\dist\build\webpack\require-hook.js:4:1784)
    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 552 (C:\projects\sitecore-ladybug\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11590)
    at __nccwpck_require__ (C:\projects\sitecore-ladybug\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
    at 270 (C:\projects\sitecore-ladybug\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:400)
    at __nccwpck_require__ (C:\projects\sitecore-ladybug\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735)
    at 327 (C:\projects\sitecore-ladybug\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:260)
    at __nccwpck_require__ (C:\projects\sitecore-ladybug\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:11735) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Can't get Builder IO working properly

Congrats on the product and mainly on the UI, it is really beautiful...

I've been trying Builder in the last 2 days and found some bugs, and challenges using it. I am not sure if I am doing something wrong.
I will list all my findings below because I think it is easier for me to list, and maybe easier for you to correlate the issues if possible.
As I've tried fixing the problems as I go (only using the UI) maybe one problem led to another 🤷🏼‍♂️, so I listed the steps I remember I took.

Please let me know if you think would be better to have each issue created separately next time.

NOTE: All issues listed were found running local env. (npm run dev)

Issue

  1. I can't get Builder IO working properly after connecting to my Shopify Development Store.
  2. Two warnings coming from @builder.io modules:
Warning: componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor.

Please update the following components: TabsComponent
Warning: React does not recognize the `_newProperty` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `_newproperty` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Expected and actual behaviors

  • Being able to link Builder to my store (Done easily 👍🏼 )
  • Being able to preview the pages inside Builder

I couldn't see some of the pages for example the Product Page > Generic template (image is attached) and I guess it is because of the URL ${space.siteUrl}/product/${previewProduct.handle} not reading the variables. If I change this URL manually to an existing page and product handle, it works 👍🏼

  • Being able to edit the previewed pages

I could somewhat edit the pages but I found it a little buggy:

  • Some times the Components weren't added to the view at all and I needed to refresh the page several times to get it back working
  • When I removed all the Components from the view (let's say the design team wants a "fresh" start), I couldn't add any other Components (video is attached)
  • Being able to see the changes on the site after publishing
  • Being able to recover the previews versions inside the HISTORY tab 👍🏼

Steps to reproduce:

  1. Clone this repo
  2. Create a Dev Store on Shopify
  3. Add some dummy data ( I used the app Simple Sample Data to add some data to my store )
  4. Follow the README.md directions until you get your store linked
  5. Go to BuilderIO and try to edit Product Page > Generic template
  6. Change the URL on the top right manually to something like http://localhost:3000/product/vans-authentic-multi-eyelets-gradient-crimson using a valid handle of course
  7. Remove all Components in the view
  8. Try to drag and drop a component to the view

Attachments

Screen.Recording.2021-04-23.at.9.14.18.PM.mov

Screen Shot 2021-04-23 at 8 03 56 PM

Screen Shot 2021-04-23 at 8 04 49 PM

Screen Shot 2021-04-23 at 8 05 08 PM

Exposing API keys

Hi! I was playing around with Builder and this example, and I noticed that your api key and other keys that should be env variables seem to be stored publicly here? I'm pretty new to shopify, but I imagine these should be in an env and not pushed. Hopefully I'm wrong and feel free to close this if I am 😄

"apiKey": "14f064d7f94eeaadf93bd8690fca1207"

No menu on mobile

On tablet and mobile, the navbar shrinks to only allow the search and cart buttons. No hamburger menu for the navbar items shows. I suggest adding that into the mix so users can more easily navigate a site made with this template.

@builder.io/cli package not found

Hi!

When attempting to install the @builder.io/cli package via npm install @builder.io/cli -g, a 404 error occurs.

When searching on npmjs.com, there also doesn't seem to be a @builder.io/cli package on the npm registry. What's the new CLI package if this has been renamed? I can't find it anywhere in the docs.

➜  spacerace npm i -g @builder/cli
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@builder%2fcli - Not found
npm ERR! 404
npm ERR! 404  '@builder/cli@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tracy/.npm/_logs/2021-02-07T17_34_28_706Z-debug.log

image

from a fresh install, the server launch and quit

it does not work for me. it compiles, launch the server, and when I open a browser at localhost:3000, it shuts the server

`

[email protected] dev
next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /Users/0-minuit-ax/Downloads/0-DEV/2-BUILDER/nsb2/.env.development
event - compiled client and server successfully in 1607 ms (767 modules)
wait - compiling /[[...path]] (client and server)...
event - compiled client and server successfully in 222 ms (776 modules)`

the build does an error also, or wait a long time on.
info - Collecting page data ...
Maybe the shopify key is not good ?

I don t know how to debug my issues and use your starter.
tks

Still unable to deploy without placeholder collections

issue created here: #18

My env variables are correct, and i am loading content from my store, but if i removed these collections from shopify i get a build error:

Error: Export encountered errors on following paths:
/en-US/collection/men
/en-US/collection/mens
/en-US/collection/spring
/en-US/collection/womens

Can we get an update?

The repo has issues above Node 14, which will no longer be supported three months from now. I also had to do some serious work fixing dependencies, but this is a great builder.io integration for nextjs. I think a seamless install will push many people towards using builder.io

Error running app

Hello, I followed the README carefully, but when I tried running the app I got this error below:

npm run dev                                                                                                  1 ↵ blkboxng@Chris

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /Users/blkboxng/Desktop/publicTrs/snaphubs/.env.development
info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
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
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in /Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:388:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:719:3)
    at resolveExports (node:internal/modules/cjs/loader:488:36)
    at Module._findPath (node:internal/modules/cjs/loader:528:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:932:27)
    at mod._resolveFilename (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/build/webpack/require-hook.js:4:1784)
    at Module._load (node:internal/modules/cjs/loader:787:27)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at 552 (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11590)
    at __nccwpck_require__ (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at 270 (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:400)
    at __nccwpck_require__ (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
    at 327 (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:260)
    at __nccwpck_require__ (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

The error says to run npx browserslist@latest --update-db , and after running that I got another error:

npx browserslist@latest --update-db                                                                          1 ↵ blkboxng@Chris
New version: 1.0.30001366
Removing old caniuse-lite from lock file
Installing new caniuse-lite version
$ npm install caniuse-lite
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @reach/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@">=14" from @builder.io/[email protected]
npm ERR!   node_modules/@builder.io/react
npm ERR!     peer @builder.io/react@"^1.1.0" from @builder.io/[email protected]
npm ERR!     node_modules/@builder.io/widgets
npm ERR!       @builder.io/widgets@"^1.2.19" from the root project
npm ERR!     @builder.io/react@"^1.1.47" from the root project
npm ERR!   react@">=14" from @builder.io/[email protected]
npm ERR!   node_modules/@builder.io/widgets
npm ERR!     @builder.io/widgets@"^1.2.19" from the root project
npm ERR!   48 more (@next/react-dev-overlay, next, @emotion/core, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @reach/[email protected]
npm ERR! node_modules/@reach/portal
npm ERR!   @reach/portal@"^0.11.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.0" from @reach/[email protected]
npm ERR!   node_modules/@reach/portal
npm ERR!     @reach/portal@"^0.11.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/blkboxng/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/blkboxng/.npm/_logs/2022-07-13T17_21_52_408Z-debug-0.log
Error: Command failed: npm install caniuse-lite
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @reach/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@">=14" from @builder.io/[email protected]
npm ERR!   node_modules/@builder.io/react
npm ERR!     peer @builder.io/react@"^1.1.0" from @builder.io/[email protected]
npm ERR!     node_modules/@builder.io/widgets
npm ERR!       @builder.io/widgets@"^1.2.19" from the root project
npm ERR!     @builder.io/react@"^1.1.47" from the root project
npm ERR!   react@">=14" from @builder.io/[email protected]
npm ERR!   node_modules/@builder.io/widgets
npm ERR!     @builder.io/widgets@"^1.2.19" from the root project
npm ERR!   48 more (@next/react-dev-overlay, next, @emotion/core, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @reach/[email protected]
npm ERR! node_modules/@reach/portal
npm ERR!   @reach/portal@"^0.11.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.0" from @reach/[email protected]
npm ERR!   node_modules/@reach/portal
npm ERR!     @reach/portal@"^0.11.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/blkboxng/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/blkboxng/.npm/_logs/2022-07-13T17_21_52_408Z-debug-0.log

    at checkExecSyncError (node:child_process:820:11)
    at Object.execSync (node:child_process:891:15)
    at updateDB (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/browserslist/update-db.js:146:18)
    at Object.<anonymous> (/Users/blkboxng/Desktop/publicTradesProperties/snaphubs/node_modules/browserslist/cli.js:40:3)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
Problem with `npm install` call. Run it manually.

Can someone help resolve this?

Thanks in advance

Error after adding product list/collection in builder.io

I am new to using builder.io and also to next.js, all the setup went well and I was able to build the app and get it working.
But when I tried to add product list or collection from the builder.io portal, the next.js app started giving the below error:

image

I haven't deployed the app yet, its running on localhost:3000
I am not sure if I missed any step or its some other issue.
Any help is appreciated,
Thanks

Getting build error when trying to deploy

Getting the following build error when trying to build my app locally. same error when trying to deploy to vercel. Any advice would be greatly appreciated!

info  - Generating static pages (38/38)

> Build error occurred
Error: Export encountered errors on following paths:
        /en-US/collection/men
        /en-US/collection/spring
        /en-US/collection/womens

 
at project/node_modules/next/dist/export/index.js:31:1106
at async Span.traceAsyncFn (project/node_modules/next/dist/telemetry/trace/trace.js:5:584)
at async project/node_modules/next/dist/build/index.js:43:49
at async Span.traceAsyncFn (project/node_modules/next/dist/telemetry/trace/trace.js:5:584)
at async project/node_modules/next/dist/build/index.js:25:1475
at async Span.traceAsyncFn (project/node_modules/next/dist/telemetry/trace/trace.js:5:584)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `next build`
npm ERR! Exit status 1


Shopify webhook disabled after failing for x times

There was an issue that's causing delete webhook to fail due to a missing param in the payload admin_graphql_api_id and eventually leading to the webhook is disabled by shopify

The API has been updated and released to accommodate for this missing param, If you ran into this issue before please reach out to [email protected] with your builder's space API key and we'll re-run the sync from Shopify, we'll keep this issue open for visibility.

failed to compile ( Argument of type '{ query: string; sortBy: string; }' )

problem poping when trying to npm run build and also in build checking while deploying on vercel ???

Type error: Argument of type '{ query: string; sortBy: string; }' is not assignable to parameter of type 'Query'.
Object literal may only specify known properties, and 'sortBy' does not exist in type 'Query'.

./lib/shopify/storefront-data-hooks/src/api/operations.ts:70:5
68 | return client.product.fetchQuery({
69 | query: searchString ? title:*${searchString}* : '',

70 | sortBy: title,
| ^
71 | })
72 | }

very low performance

Hi,
after I set up everything and try to use the builder to generate the website.
it seems very slow. I need 41.9s to render the first contentful paint.
is there anything I got wrong?

image

What happened to my Shopify <> Builder sync requests?

TLDR;

The syncing process is deprecated, please pull in the latest code from master to hit Shopify Storefront API directly.

Syncing and importing Shopify products to Builder has been deprecated, it was originally introduced as a workaround for Shopify Storefront API rate limits which in retrospect proved to be not an issue for the vast majority of users, please pull the latest code from master where we hit the Shopify Storefront API directly for all things Shopify. ( in this commit )

CORS error with the product/[handle].tsx with plugin-shopify

When trying to load a product detail page in the iFrame, the product details seem to flash quickly on the screen then it goes blank (grey). No errors on the site but the console is riddled with CORS issues.

The odd part is that it's between the origin https://builder.io and https://cdn.builder.io. It seems to be complaining about plugin-shopify.

The specific call is to the Shopify plugin and I've traced it to the point where it becomes code that I don't have access to.

The products on the home page are loading fine, so it doesn't seem to be an issue with the Shopify connection.

CORS error:

    Access to fetch at 'https://cdn.builder.io/api/v1/shopify/storefront/product/gid://shopify/Product/8132652663105?apiKey=e9da8b4ec1994cafb66f28c23b884c5c&[email protected]/plugin-shopify' from origin 'https://builder.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Posted on forum as well but no solid leads yet and I'd really love to make progress on this!

Failed to open Hook Call.

During Yarn run dev I get the error.

Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app

Unable to install nextjs-shopify project due to dependency problems

I am trying to install the nextjs-shopify project, but I am having dependency problems. I have tried using npm to update the dependencies and using the -force flag, but the more I try the more problems I get. Is there anyone willing to help me figure out what I'm doing wrong and how I can get this working?

Add yarn support [TypeError: Cannot read properties of null (reading 'useContext')]

During a yarn run dev, I get the error

TypeError: Cannot read properties of null (reading 'useContext')

Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'useContext')

Call Stack
useContext
node_modules/@emotion/styled/node_modules/react/cjs/react.development.js (1616:0)
eval
node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js (122:39)
eval
node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js (36:0)
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js (14985:0)
updateForwardRef
node_modules/react-dom/cjs/react-dom.development.js (17044:0)
beginWork
node_modules/react-dom/cjs/react-dom.development.js (19098:0)
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js (3945:0)
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js (3994:0)
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js (4056:0)
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js (23964:0)
performUnitOfWork
node_modules/react-dom/cjs/react-dom.development.js (22776:0)
workLoopSync
node_modules/react-dom/cjs/react-dom.development.js (22707:0)
renderRootSync
node_modules/react-dom/cjs/react-dom.development.js (22670:0)
performSyncWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js (22293:0)
eval
node_modules/react-dom/cjs/react-dom.development.js (11327:0)
unstable_runWithPriority
node_modules/scheduler/cjs/scheduler.development.js (468:0)
runWithPriority$1
node_modules/react-dom/cjs/react-dom.development.js (11276:0)
flushSyncCallbackQueueImpl
node_modules/react-dom/cjs/react-dom.development.js (11322:0)
flushSyncCallbackQueue
node_modules/react-dom/cjs/react-dom.development.js (11309:0)
scheduleUpdateOnFiber
node_modules/react-dom/cjs/react-dom.development.js (21893:0)
Object.enqueueSetState
node_modules/react-dom/cjs/react-dom.development.js (12467:0)
Component.setState
node_modules/@builder.io/react/node_modules/react/cjs/react.development.js (352:0)
eval
node_modules/@builder.io/react/dist/builder-react.es5.js (15:25478)
BehaviorSubject.next
node_modules/@builder.io/sdk/dist/index.esm.js (171:0)
eval
node_modules/@builder.io/sdk/dist/index.esm.js (2297:0)

Unhandled Run Time Error

Hello, I'm having issues adding my product on builder.io. It show's all the products but immediately after adding it throws an error.
2021-05-27 (2)

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.