Git Product home page Git Product logo

sanity-io / example-company-website-gatsby-sanity-combo Goto Github PK

View Code? Open in Web Editor NEW
274.0 8.0 142.0 3.01 MB

This is an example company website using Gatsby and Sanity in combination.

Home Page: https://example-company-website-gatsby-sanity-combo.now.sh

License: MIT License

JavaScript 81.04% CSS 18.96%
gatsby jamstack jamstack-site headless-cms cms structured-content portable-text sanity

example-company-website-gatsby-sanity-combo's Introduction

A sample company website built with Gatsby & Sanity.io

This examples combines Gatsby site generation with Sanity content management in a neat little company website. Read the blog post and see the getting started video.

Watch a video about the company website built with Gatsby using Sanity.io as a headless CMS

See the example up and running

Features

A company website built with Gatsby

  • ๐Ÿ“ก Real-time content preview in development
  • โฑ Fast & frugal builds
  • ๐Ÿ—ƒ No accidental missing fields/types
  • ๐Ÿงฐ Full Render Control with Portable Text
  • ๐Ÿ“ธ gatsby-image support
  • ๐Ÿ”ง Minimal configuration

Sanity Studio with a schema for

  • ๐Ÿข Company info
  • ๐Ÿ“ƒ Pages
  • ๐Ÿ‘จ๐Ÿผโ€๐ŸŽจ Projects
  • ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿ’ป People
  • ๐Ÿ“ฐ Blog posts

Installation

Read the step-by-step blog post.

git clone [email protected]:sanity-io/example-company-website-gatsby-sanity-combo.git
cd example-company-website-gatsby-sanity-combo
npm install

# Install or upgrade the Sanity CLI to
# make sure you are on v0.140.0 or higher
npm install -g @sanity/cli
# Set up Sanity.io account and project (โ‰ˆ 45s)
npm run init

See the getting started video for a walkthrough of the installation.

Enable Gatsby watch mode for drafts

We have enabled the watch mode in the gatsby-source-sanity plugin, which means that your frontend will automatically update with content changes whenever you publish them. If you want the frontend to show content changes in real time, you must do the following:

  • Go to manage.sanity.io and find your project (or run the command sanity manage in the studio folder)
  • Navigate to Settings->API and scroll down to the Tokens section
  • Add a new token and give it read privileges.
  • Copy the .env-example file to a file called .env in the /web folder
  • Add your new token to the key: SANITY_TOKEN="<token here>"

If you restart the local development server, it will now show unpublished changes from the Studio. Note that the .env file is ignored by Git, because the token gives access to unpublished content in the API.

Usage example

This project demos Sanity.io with Gatsby using our source plugin. It's a good starter for a simple company site, a portfolio site for an agency or a personal blog with an attached portfolio.

We tried to strike a balance between a useful example and a minimal footprint to make it easier to iterate on design and content model. Let us know should you have questions!

Development setup

Run it

npm start
# Studio at http://localhost:3333
# Web frontend at http://localhost:8000
# GraphiQL explorer at http://localhost:8000/___graphql

Development workflow

We wrote a blog post about how to use this example, but if you would like to just start tinkering:

  • The Sanity Studio keeps its schemas in ./studio/schemas. We will hot reload the editor when you edit them so just start experimenting. Read more about our schemas here.
  • We followed Gatsby conventions and you can read all about them here.
  • If you want Gatsby to not throw errors on missing fields for unpopulated data you need to redeploy the GraphQL API so we can generate schemas โ€“ย npm run graphql-deploy

Deployment

# Deploy a GraphQL API and schema to Sanity
npm run graphql-deploy

# Deploy the Sanity Studio to *.sanity.studio
npm run sanity-deploy

# Build & deploy to Zeit's Now. Remember to set `basePath` to "/studio" in sanity.json
npm run now-deploy

Deploy on Netlify: If you want to deploy the Gatsby site to Netlify we added a netlify.toml config for you.

Fork or clone the example to your GitHub account. After adding your repo to Netlify youโ€™ll get automatic builds & deploys when pushing to master. You can also add a webhook to get deploys on content changes.

Deploy on Cloudflare: If you want to deploy the Gatsby site to Cloudflare we added a wrangler.toml and workers-site/ to both studio and web.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

MIT

example-company-website-gatsby-sanity-combo's People

Contributors

chrislangston avatar dashon-hawkins avatar dependabot-preview[bot] avatar dependabot-support avatar evenwestvang avatar exvuma avatar jorngeorg avatar kmelve avatar magneh avatar mariuslundgard avatar nilsborg avatar rexxars avatar rogeliorv avatar runeb 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

example-company-website-gatsby-sanity-combo's Issues

Using Gatsby Cloud - Preview build fails

If you install the project to Gatsby Cloud the preview build fails with the following error:

Error Generating development JavaScript bundle failed /usr/src/app/www/web/src/components/block-content/slideshow.js

Error React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return? react-hooks/rules-of-hooks

"Site Settings", "Company Info", "Pages" not editable on first run

Describe the bug
Followed the setup instructions and everything works fine for People, Blog Posts etc but not not for the options listed. The form fields present as not editable. (Inspect shows the markup set to readonly) Not sure if this is expected behavior somehow and I am missing something?

To Reproduce
Steps to reproduce the behavior:

  1. Install per instructions
  2. Run studio
  3. Click on "Site Settings" (same for other sections)
  4. Attempt to edit

Expected behavior
On install, all content options are editable, since the site won't display without the data.

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2019-12-21 at 6 56 40 AM
Screen Shot 2019-12-21 at 7 05 18 AM

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browsers tried: Chrome, Safari, Firefox
  • Version Latest

sanity-deploy from a fresh install fails to deploy/build properly

Describe the bug
From a fresh clone of the project, and creating a new project, and deployment (sanity-deploy), the project fails to build properly, and the "Connection to Sanity.io" loading animation doesn't go away. In addition, Chrome dev tools reports a failed build. See screenshots.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the project
  2. Change the project ID for a fresh deployment
  3. yarn run sanity-deploy
  4. See error

Expected behavior
Deployment shouldn't fail

Screenshots
loading-never-stops
Screen Shot 2019-06-07 at 9 54 22 PM

Desktop (please complete the following information):
OS: OSX 10.14.5
Browser: Chrome
Version 74.0.3729
@sanity/cli 0.140.33 (up to date)
@sanity/base 0.140.33 (up to date)
@sanity/cli 0.140.33 (up to date)
@sanity/components 0.140.33 (up to date)
@sanity/core 0.140.32 (up to date)
@sanity/default-layout 0.140.33 (up to date)
@sanity/default-login 0.140.15 (up to date)
@sanity/desk-tool 0.140.33 (up to date)

Unknown field '_rawBody' on type 'SanityDynamicPage'

I have duplicated the existing post schema and template to get createable dynamic pages from within Sanity. All works except the _rawBody field used in all the other pages. This field didn't get generated automatically after setting up the schema. body was created just fine, storing all the blocks in a nested array. But I am unable to query _rawBody to pass directly to @sanity/block-content-to-react, instead I have to query all the nested fields in the body field which doesn't seem scalable. This also causes the Figure block inside the body to get the asset id instead of the url which throws an error.

Expected behavior
I expected my new dynamicPage schema to behave exactly like the post schema from which it was duplicated, thus automatically generating the _rawBody field.

Site deploy fails to build with "failed during stage 'building site': Deploy directory 'web/web/public' does not exist"

Hello - I am trying to build a new site using the repo using netlify. I followed the instructions from "https://www.sanity.io/blog/how-to-quickly-set-up-a-gatsby-js-jamstack-website-with-a-headless-cms" but site fails to build with the message

"failed during stage 'building site': Deploy directory 'web/web/public' does not exist"

This is the full Netlify deploy job:

9:03:55 AM: Build ready to start
9:04:16 AM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
9:04:16 AM: build-image tag: v3.3.2
9:04:16 AM: buildbot version: a2bab682ae0761baa4d123ebd00c57be933655dc
9:04:17 AM: Fetching cached dependencies
9:04:17 AM: Failed to fetch cache, continuing with build
9:04:17 AM: Starting to prepare the repo for build
9:04:17 AM: No cached dependencies found. Cloning fresh repo
9:04:17 AM: git clone https://github.com/judepark/judepark.com
9:04:18 AM: Preparing Git Reference refs/heads/master
9:04:18 AM: Found netlify.toml. Overriding site configuration
9:04:18 AM: Different base path detected, going to use the one specified in the toml file: 'web/' versus '' in the site
9:04:18 AM: Starting build script
9:04:19 AM: Installing dependencies
9:04:20 AM: Downloading and installing node v10.17.0...
9:04:20 AM: Downloading https://nodejs.org/dist/v10.17.0/node-v10.17.0-linux-x64.tar.xz...
9:04:21 AM: 
##########
9:04:21 AM:                 15.1%
9:04:21 AM: 
#######################################################
9:04:21 AM: ################# 100.0%
9:04:21 AM: Computing checksum with sha256sum
9:04:21 AM: Checksums matched!
9:04:24 AM: Now using node v10.17.0 (npm v6.11.3)
9:04:24 AM: Attempting ruby version 2.6.2, read from environment
9:04:25 AM: Using ruby version 2.6.2
9:04:26 AM: Using PHP version 5.6
9:04:26 AM: Started restoring cached node modules
9:04:26 AM: Finished restoring cached node modules
9:04:26 AM: Installing NPM modules using NPM version 6.11.3
9:04:59 AM: > [email protected] postinstall /opt/build/repo/web/node_modules/@babel/polyfill/node_modules/core-js
9:04:59 AM: > node scripts/postinstall || echo "ignore"
9:04:59 AM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
9:04:59 AM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
9:04:59 AM: > https://opencollective.com/core-js 
9:04:59 AM: > https://www.patreon.com/zloirock 
9:04:59 AM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
9:04:59 AM: > [email protected] postinstall /opt/build/repo/web/node_modules/gatsby/node_modules/core-js
9:04:59 AM: > node scripts/postinstall || echo "ignore"
9:04:59 AM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
9:04:59 AM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
9:04:59 AM: > https://opencollective.com/core-js 
9:04:59 AM: > https://www.patreon.com/zloirock 
9:04:59 AM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
9:04:59 AM: > [email protected] postinstall /opt/build/repo/web/node_modules/gatsby-telemetry
9:04:59 AM: > node src/postinstall.js
9:04:59 AM: > [email protected] postinstall /opt/build/repo/web/node_modules/gatsby
9:04:59 AM: > node scripts/postinstall.js
9:05:02 AM: npm
9:05:02 AM: WARN [email protected] No description
9:05:02 AM: npm WARN [email protected] No repository field.
9:05:02 AM: npm WARN [email protected] No license field.
9:05:02 AM: npm
9:05:02 AM: WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
9:05:02 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:05:02 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
9:05:02 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:05:02 AM: added 1791 packages from 868 contributors and audited 21287 packages in 35.072s
9:05:02 AM: found 29 vulnerabilities (24 high, 5 critical)
9:05:02 AM:   run `npm audit fix` to fix them, or `npm audit` for details
9:05:02 AM: NPM modules installed
9:05:02 AM: Started restoring cached go cache
9:05:02 AM: Finished restoring cached go cache
9:05:02 AM: unset GOOS;
9:05:02 AM: unset GOARCH;
9:05:02 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
9:05:02 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
9:05:02 AM: go version >&2;
9:05:02 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
9:05:02 AM: go version go1.12 linux/amd64
9:05:02 AM: Installing missing commands
9:05:02 AM: Verify run directory
9:05:02 AM: Executing user command: npm run build
9:05:03 AM: > [email protected] build /opt/build/repo/web
9:05:03 AM: > gatsby build
9:05:05 AM: success open and validate gatsby-configs โ€” 0.030
9:05:06 AM: success load plugins โ€” 0.456
9:05:06 AM: success onPreInit โ€” 0.019
9:05:06 AM: success delete html and css files from previous builds โ€” 0.026
9:05:06 AM: success initialize cache โ€” 0.020
9:05:06 AM: success copy gatsby files โ€” 0.052
9:05:06 AM: warning [sanity] `overlayDrafts` is set to `true`, but no token is given
9:05:06 AM: warning [sanity] Using `watchMode` when not in develop mode might prevent your build from completing
9:05:06 AM: info [sanity] Fetching remote GraphQL schema
9:05:06 AM: info [sanity] Transforming to Gatsby-compatible GraphQL SDL
9:05:07 AM: info [sanity] Stitching GraphQL schemas from SDL
9:05:07 AM: success onPreBootstrap โ€” 0.376
9:05:07 AM: info [sanity] Fetching export stream for dataset
9:05:07 AM: info [sanity] Watch mode enabled, starting a listener
9:05:07 AM: info [sanity] Done exporting!
9:05:07 AM: success source and transform nodes โ€” 0.290
9:05:07 AM: success Add explicit types โ€” 0.040
9:05:07 AM: success Add inferred types โ€” 0.080
9:05:07 AM: success Processing types โ€” 0.218
9:05:07 AM: success building schema โ€” 0.432
9:05:07 AM: success createPages โ€” 0.039
9:05:07 AM: success createPagesStatefully โ€” 0.110
9:05:07 AM: success onPreExtractQueries โ€” 0.021
9:05:08 AM: success update schema โ€” 0.044
9:05:08 AM: warning The GraphQL query in the non-page component "/opt/build/repo/web/src/templates/blog-post.js" will not be run.
9:05:08 AM: warning The GraphQL query in the non-page component "/opt/build/repo/web/src/templates/project.js" will not be run.
9:05:08 AM: Exported queries are only executed for Page components. It's possible you're
9:05:08 AM: trying to create pages in your gatsby-node.js and that's failing for some
9:05:08 AM: reason.
9:05:08 AM: If the failing component(s) is a regular component and not intended to be a page
9:05:08 AM: component, you generally want to use a <StaticQuery> (https://gatsbyjs.org/docs/static-query)
9:05:08 AM: instead of exporting a page query.
9:05:08 AM: If you're more experienced with GraphQL, you can also export GraphQL
9:05:08 AM: fragments from components and compose the fragments in the Page component
9:05:08 AM: query and pass data down into the child component โ€” http://graphql.org/learn/queries/#fragments
9:05:08 AM: success extract queries from components โ€” 0.525
9:05:08 AM: success write out requires โ€” 0.024
9:05:08 AM: success write out redirect data โ€” 0.020
9:05:08 AM: success onPostBootstrap โ€” 0.016
9:05:08 AM: info bootstrap finished - 5.467 s
9:05:08 AM: success run static queries โ€” 0.034 โ€” 2/2 142.35 queries/second
9:05:30 AM: success Building production JavaScript and CSS bundles โ€” 22.206
9:05:31 AM: success Rewriting compilation hashes โ€” 0.039
9:05:31 AM: success run page queries โ€” 0.157 โ€” 7/7 85.85 queries/second
9:05:36 AM: success Building static HTML for pages โ€” 5.005 โ€” 7/7 28.32 pages/second
9:05:36 AM: info Done building in 33.127 sec
9:05:36 AM: Skipping functions preparation step: no functions directory set
9:05:36 AM: Caching artifacts
9:05:36 AM: Started saving node modules
9:05:36 AM: Finished saving node modules
9:05:36 AM: Started saving pip cache
9:05:36 AM: Finished saving pip cache
9:05:36 AM: Started saving emacs cask dependencies
9:05:36 AM: Finished saving emacs cask dependencies
9:05:36 AM: Started saving maven dependencies
9:05:36 AM: Finished saving maven dependencies
9:05:36 AM: Started saving boot dependencies
9:05:36 AM: Finished saving boot dependencies
9:05:36 AM: Started saving go dependencies
9:05:36 AM: Finished saving go dependencies
9:05:39 AM: Build script success
9:05:39 AM: Failing build: Failed to build site
9:05:39 AM: failed during stage 'building site': Deploy directory 'web/web/public' does not exist
9:05:39 AM: Finished processing build request in 1m22.727545616s

I expect it to build fine but it seems to have trouble with the deploy direction 'web/web/public", so I tried changing it in settings in Netlify. I tried all methods:

Base directory: web
Publish directory: web/ public

or

Base directory: none
Publish directory: web/public

or

Base directory: web
Publish directory: public

Annotation 2019-11-19 091146

Can someone help me deploy my site to netlify?

npm run now-deploy

Describe the bug
Following the instructions I get an error message when I try to npm run now-deploy (I get the same error if I deploy to Zeit via GitHub):

On Zeit the site fails to deploy and returns an error message in the log:

Error: Build was unable to create the distDir: public.
Make sure you mentioned the correct dist directory: https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build/#configuring-the-dist-directory
    at validateDistDir (/tmp/utils/build-module/node_modules/@now/static-build/index.js:16:11)
    at Object.exports.build (/tmp/utils/build-module/node_modules/@now/static-build/index.js:37:7)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Expected behavior
No error when deploying to Zeit.

Desktop (please complete the following information):

  • OS: Windows 10

Fails to deploy to Netlify. `Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform.'

Hi there,

My site works great locally. However, when I followed the instructions provided here in order to deploy to Netlify the deployment failed:
"https://www.sanity.io/blog/how-to-quickly-set-up-a-gatsby-js-jamstack-website-with-a-headless-cms"

I get multiple errors when attempting to deploy to Netlify:

Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Pleas e remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-x64' platform.

Here's the full failed deploy log:

4:30:27 PM: Build ready to start
4:30:29 PM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849
4:30:29 PM: build-image tag: v3.6.0
4:30:29 PM: buildbot version: 9439037c11fb06c8c7a70d41fbf4be866b228390
4:30:29 PM: Fetching cached dependencies
4:30:29 PM: Failed to fetch cache, continuing with build
4:30:29 PM: Starting to prepare the repo for build
4:30:29 PM: No cached dependencies found. Cloning fresh repo
4:30:29 PM: git clone https://github.com/StudioCC17/chris-new
4:30:33 PM: Preparing Git Reference refs/heads/main
4:30:34 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: 'web' versus '' in the Netlify UI
4:30:34 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'web/public' versus 'public' in the Netlify UI
4:30:34 PM: Starting build script
4:30:34 PM: Installing dependencies
4:30:34 PM: Python version set to 2.7
4:30:35 PM: v12.18.0 is already installed.
4:30:36 PM: Now using node v12.18.0 (npm v6.14.4)
4:30:36 PM: Started restoring cached build plugins
4:30:36 PM: Finished restoring cached build plugins
4:30:36 PM: Attempting ruby version 2.7.1, read from environment
4:30:37 PM: Using ruby version 2.7.1
4:30:38 PM: Using PHP version 5.6
4:30:38 PM: Started restoring cached node modules
4:30:38 PM: Finished restoring cached node modules
4:30:38 PM: Installing NPM modules using NPM version 6.14.4
4:31:13 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/core-js
4:31:13 PM: > node postinstall || echo "ignore"
4:31:13 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/core-js-pure
4:31:13 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:31:13 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/prettier-eslint-cli/node_modules/core-js
4:31:13 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:31:14 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/prettier-eslint/node_modules/core-js
4:31:14 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:31:14 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/gatsby-telemetry
4:31:14 PM: > node src/postinstall.js || true
4:31:14 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/gatsby/node_modules/gatsby-cli
4:31:14 PM: > node scripts/postinstall.js
4:31:14 PM: > @cloudflare/[email protected] postinstall /opt/build/repo/web/node_modules/@cloudflare/wrangler
4:31:14 PM: > node ./install-wrangler.js
4:31:14 PM: Downloading release https://workers.cloudflare.com/get-npm-wrangler-binary/1.12.2/x86_64-unknown-linux-musl
4:31:16 PM: wrangler has been installed!
4:31:16 PM: > [email protected] postinstall /opt/build/repo/web/node_modules/gatsby
4:31:16 PM: > node scripts/postinstall.js
4:31:18 PM: npm WARN [email protected] No description
4:31:18 PM: npm WARN [email protected] No repository field.
4:31:18 PM: npm WARN [email protected] No license field.
4:31:18 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
4:31:18 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:31:18 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
4:31:18 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:31:18 PM: added 1883 packages from 883 contributors and audited 1956 packages in 39.726s
4:31:20 PM: 19 packages are looking for funding
4:31:20 PM:   run `npm fund` for details
4:31:20 PM: found 831 vulnerabilities (810 low, 8 moderate, 13 high)
4:31:20 PM:   run `npm audit fix` to fix them, or `npm audit` for details
4:31:20 PM: NPM modules installed
4:31:20 PM: Started restoring cached go cache
4:31:20 PM: Finished restoring cached go cache
4:31:20 PM: go version go1.14.4 linux/amd64
4:31:20 PM: go version go1.14.4 linux/amd64
4:31:20 PM: Installing missing commands
4:31:20 PM: Verify run directory
4:31:22 PM: โ€‹
4:31:22 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4:31:22 PM:   Netlify Build                                                 
4:31:22 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4:31:22 PM: โ€‹
4:31:22 PM: โฏ Version
4:31:22 PM:   @netlify/build 7.0.0
4:31:22 PM: โ€‹
4:31:22 PM: โฏ Flags
4:31:22 PM:   buildImagePluginsDir: /opt/buildhome/.netlify-build-plugins/node_modules
4:31:22 PM:   deployId: 5fd39ea38fce210ecb88a069
4:31:22 PM:   mode: buildbot
4:31:22 PM: โ€‹
4:31:22 PM: โฏ Current directory
4:31:22 PM:   /opt/build/repo/web
4:31:22 PM: โ€‹
4:31:22 PM: โฏ Config file
4:31:22 PM:   /opt/build/repo/netlify.toml
4:31:22 PM: โ€‹
4:31:22 PM: โฏ Context
4:31:22 PM:   production
4:31:22 PM: โ€‹
4:31:22 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4:31:22 PM:   1. build.command from netlify.toml                            
4:31:22 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4:31:22 PM: โ€‹
4:31:22 PM: $ npm run build
4:31:22 PM: > [email protected] build /opt/build/repo/web
4:31:22 PM: > gatsby build
4:31:24 PM: success open and validate gatsby-configs - 0.017s
4:31:24 PM: warning Plugin gatsby-plugin-manifest is not compatible with your gatsby version 2.18.7 - It requires gatsby@^2.25.0
4:31:25 PM: error Error in "/opt/build/repo/node_modules/gatsby-plugin-manifest/gatsby-node.js": 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-x64' platform.
4:31:25 PM: 
4:31:25 PM: 
4:31:25 PM:   Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Pleas  e remove the 'node_modules/sharp' directory and run 'npm install' on the 'linu  x-x64' platform.
4:31:25 PM:   
4:31:25 PM:   - libvips.js:62 Object.hasVendoredLibvips
4:31:25 PM:     [repo]/[sharp]/lib/libvips.js:62:13
4:31:25 PM:   
4:31:25 PM:   - constructor.js:7 Object.<anonymous>
4:31:25 PM:     [repo]/[sharp]/lib/constructor.js:7:22
4:31:25 PM:   
4:31:25 PM:   - v8-compile-cache.js:178 Module._compile
4:31:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:178:30
4:31:25 PM:   
4:31:25 PM:   - loader.js:1158 Object.Module._extensions..js
4:31:25 PM:     internal/modules/cjs/loader.js:1158:10
4:31:25 PM:   
4:31:25 PM:   - loader.js:986 Module.load
4:31:25 PM:     internal/modules/cjs/loader.js:986:32
4:31:25 PM:   
4:31:25 PM:   - loader.js:879 Function.Module._load
4:31:25 PM:     internal/modules/cjs/loader.js:879:14
4:31:25 PM:   
4:31:25 PM:   - loader.js:1026 Module.require
4:31:25 PM:     internal/modules/cjs/loader.js:1026:19
4:31:25 PM:   
4:31:25 PM:   - v8-compile-cache.js:159 require
4:31:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:159:20
4:31:25 PM:   
4:31:25 PM:   - index.js:3 Object.<anonymous>
4:31:25 PM:     [repo]/[sharp]/lib/index.js:3:15
4:31:25 PM:   
4:31:25 PM:   - v8-compile-cache.js:178 Module._compile
4:31:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:178:30
4:31:25 PM:   
4:31:25 PM:   - loader.js:1158 Object.Module._extensions..js
4:31:25 PM:     internal/modules/cjs/loader.js:1158:10
4:31:25 PM:   
4:31:25 PM:   - loader.js:986 Module.load
4:31:25 PM:     internal/modules/cjs/loader.js:986:32
4:31:25 PM:   
4:31:25 PM:   - loader.js:879 Function.Module._load
4:31:25 PM:     internal/modules/cjs/loader.js:879:14
4:31:25 PM:   
4:31:25 PM:   - loader.js:1026 Module.require
4:31:25 PM:     internal/modules/cjs/loader.js:1026:19
4:31:25 PM:   
4:31:25 PM:   - v8-compile-cache.js:159 require
4:31:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:159:20
4:31:25 PM:   
4:31:25 PM:   - safe-sharp.js:132 Object.<anonymous>
4:31:25 PM:     [repo]/[gatsby-plugin-manifest]/safe-sharp.js:132:11
4:31:25 PM:   
4:31:25 PM: 
4:31:25 PM: not finished load plugins - 0.347s
4:31:25 PM: npm ERR! code ELIFECYCLE
4:31:25 PM: npm ERR! errno 1
4:31:25 PM: npm ERR! [email protected] build: `gatsby build`
4:31:25 PM: npm ERR! Exit status 1
4:31:25 PM: npm ERR!
4:31:25 PM: npm ERR! Failed at the [email protected] build script.
4:31:25 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
4:31:25 PM: npm ERR! A complete log of this run can be found in:
4:31:25 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-12-11T16_31_25_291Z-debug.log
4:31:25 PM: โ€‹
4:31:25 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4:31:25 PM:   "build.command" failed                                        
4:31:25 PM: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4:31:25 PM: โ€‹
4:31:25 PM:   Error message
4:31:25 PM:   Command failed with exit code 1: npm run build
4:31:25 PM: โ€‹
4:31:25 PM:   Error location
4:31:25 PM:   In build.command from netlify.toml:
4:31:25 PM:   npm run build
4:31:25 PM: โ€‹
4:31:25 PM:   Resolved config
4:31:25 PM:   build:
4:31:25 PM:     base: /opt/build/repo/web
4:31:25 PM:     command: npm run build
4:31:25 PM:     commandOrigin: config
4:31:25 PM:     publish: /opt/build/repo/web/public
4:31:25 PM: Caching artifacts
4:31:25 PM: Started saving node modules
4:31:25 PM: Finished saving node modules
4:31:25 PM: Started saving build plugins
4:31:25 PM: Finished saving build plugins
4:31:25 PM: Started saving pip cache
4:31:25 PM: Finished saving pip cache
4:31:25 PM: Started saving emacs cask dependencies
4:31:25 PM: Finished saving emacs cask dependencies
4:31:25 PM: Started saving maven dependencies
4:31:25 PM: Finished saving maven dependencies
4:31:25 PM: Started saving boot dependencies
4:31:25 PM: Finished saving boot dependencies
4:31:25 PM: Started saving rust rustup cache
4:31:25 PM: Finished saving rust rustup cache
4:31:25 PM: Started saving rust cargo bin cache
4:31:25 PM: Finished saving rust cargo bin cache
4:31:25 PM: Started saving go dependencies
4:31:25 PM: Finished saving go dependencies
4:31:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:31:28 PM: Failing build: Failed to build site
4:31:28 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:31:28 PM: Finished processing build request in 59.498523782s

I've tried removing the sharp directory and reinstalling but doesn't solve anything.

I've had a great, smooth experience with Sanity so far but cannot seem to solve this issue. Hoping someone can help me out here.

Gatsby - Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './is-truthy' is not defined by "exports" in..

Describe the bug
I tried to create a new gatsby website from a repo and tried to develop it, but now am having issues with some "is-truthy" not being defined in my exports

To Reproduce
Steps to reproduce the behavior:

  1. command "gatsby develop" on existing project that used to work seamlessly, but now I see this error message:
  2. Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './is-truthy' is not defined by "exports"

Expected behavior
I expect my old projects or even commands like "gatsby -v" to run, but now can't due to this error message.

Screenshots
internal/modules/cjs/loader.js:497
throw new ERR_PACKAGE_PATH_NOT_EXPORTED(basePath, mappingKey);
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './is-truthy' is not defined by "exports" in C:\Users\jude\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\gatsby-core-utils\package.json
at applyExports (internal/modules/cjs/loader.js:497:9)
at resolveExports (internal/modules/cjs/loader.js:513:23)
at Function.Module._findPath (internal/modules/cjs/loader.js:641:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1016:27)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at Object. (C:\Users\jude\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\reporter.js:34:17)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Desktop (please complete the following information):

  • OS: windows 10
  • VS up to date

Additional context
new to coding, kinda panicking that I can't work on my old projects anymore

"See the example up and running" in README.md just links to youtube video

The "See the example up and running" just links to a video showcasing live watch mode. I use this repo to draw inspiration and it would be great with a working live example of the site instead of just a link to a youtube-video. This is also what I thought I would get when pressing "See the example up and running"

Missing "Site settings"...

Describe the bug
On a new clone I have followed the readme instructions (and read/watched blog post).

I have added site and company info settings - these are marked as synced.
Restarting the server with npm start still doesn't remove this error:

Error: Missing "Site settings". Open the studio at http://localhost:3333 and add some content to "Site settings" and restart the development server.

It might or might not be relevant, but sanity is not deployed at this stage and the site and company settings are marked as 'draft'

To Reproduce
Steps to reproduce the behavior:

  1. clone new site from this repo and follow these instructions:
git clone [email protected]:sanity-io/example-company-website-gatsby-sanity-combo.git
cd example-company-website-gatsby-sanity-combo
npm install

# Install or upgrade the Sanity CLI to
# make sure you are on v0.140.0 or higher
npm install -g @sanity/cli
# Set up Sanity.io account and project (โ‰ˆ 45s)
npm run init

Desktop (please complete the following information):

  • OS: Mac OS 10.14
  • chrome

I also have the following warnings:
warn The GraphQL query in the non-page component
example-company-website-gatsby-sanity-combo-frontend: "/Users/alistairmcclymont/Sites/amcc.io/am-sanity/web/src/templates/blog-post.js" will not be run.
warn The GraphQL query in the non-page component
example-company-website-gatsby-sanity-combo-frontend: "/Users/alistairmcclymont/Sites/amcc.io/am-sanity/web/src/templates/project.js" will not be run.
Exported queries are only executed for Page components. It's possible you're
example-company-website-gatsby-sanity-combo-frontend: trying to create pages in your gatsby-node.js and that's failing for some
example-company-website-gatsby-sanity-combo-frontend: reason.

example-company-website-gatsby-sanity-combo-frontend: 8 pages example-company-website-gatsby-s
example-company-website-gatsby-sanity-combo-frontend: anity-combo-frontend
example-company-website-gatsby-sanity-combo-studio: webpack built f05639d508c83f40a57c in 19147ms
example-company-website-gatsby-sanity-combo-studio: Content Studio successfully compiled! Go to http://localhost:3333

Running `yarn run sanity-deploy` at the root, just hangs

I've just cloned the project, and prepared to deploy the project. Running npm or yarn run sanity-deploy at the root directory just hangs on lerna info Executing command in 1 package: "npm run sanity-deploy"

Expected behavior
This command should run sanity-deploy in the /studio directory without having to go in that directory to deploy.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: OSX 10.14.5
  • Browser: Chrome
  • Version 74.0.3729

@sanity/cli 0.140.33 (up to date)
@sanity/base 0.140.33 (up to date)
@sanity/cli 0.140.33 (up to date)
@sanity/components 0.140.33 (up to date)
@sanity/core 0.140.32 (up to date)
@sanity/default-layout 0.140.33 (up to date)
@sanity/default-login 0.140.15 (up to date)
@sanity/desk-tool 0.140.33 (up to date)

Cannot query field "allSanityPost" on type "Query"

Hi,
I cloned the repo, followed the blog post here and added all the content in my local Sanity Studio as described in the article, but I keep getting Cannot query field "allSanityPost" on type "Query" when I run yarn start.
Any idea why?

Thank you

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.