Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

"gatsby-source-storyblok" threw an error while running the sourceNodes lifecycle: Request failed with status code 401 #697

Open
1 task done
nseokaneJHB opened this issue Jun 24, 2024 · 0 comments
Labels
pending-author [Issue] Add Storyblok employee pending-triage [Issue] Add labels to describe it or prioritise it

Comments

@nseokaneJHB
Copy link

Describe the issue you're facing

Running yarn build gives me this error

✗ yarn build
yarn run v1.22.19
$ gatsby build
warn Plugin gatsby-plugin-styled-components is not compatible with your gatsby version 3.15.0 - It requires gatsby@^5.0.0-next
warn Plugin gatsby-plugin-styled-components is not compatible with your gatsby version 3.15.0 - It requires gatsby@^5.0.0-next
success open and validate gatsby-configs, load plugins - 1.879s
success onPreInit - 0.005s
success initialize cache - 0.086s
success copy gatsby files - 0.106s
success Compiling Gatsby Functions - 0.222s
success onPreBootstrap - 0.253s
success createSchemaCustomization - 0.044s

 ERROR #11321  PLUGIN

"gatsby-source-storyblok" threw an error while running the sourceNodes lifecycle:

Request failed with status code 401



  Error: Request failed with status code 401
  
  - createError.js:16 createError
    [reseller-web]/[axios]/lib/core/createError.js:16:15
  
  - settle.js:17 settle
    [reseller-web]/[axios]/lib/core/settle.js:17:12
  
  - http.js:269 IncomingMessage.handleStreamEnd
    [reseller-web]/[axios]/lib/adapters/http.js:269:11
  
  - node:events:529 IncomingMessage.emit
    node:events:529:35
  
  - node:domain:489 IncomingMessage.emit
    node:domain:489:12
  
  - readable:1400 endReadableNT
    node:internal/streams/readable:1400:12
  
  - task_queues:82 processTicksAndRejections
    node:internal/process/task_queues:82:21
  

not finished source and transform nodes - 1.066s

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

this is my gatsby-config.js

const activeEnv =
  process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development"

// eslint-disable-next-line @typescript-eslint/no-var-requires
require("dotenv").config({
  path: `.env.${activeEnv}`,
})

require("ts-node").register()

module.exports = {
  siteMetadata: {
    title: `My title`,
    description: `My description.`,
  },
  plugins: [
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-styled-components`,
    `gatsby-plugin-sass`,
    `gatsby-plugin-image`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#fff`,
        theme_color: `#fff`,
        display: `minimal-ui`,
        icon: `src/images/favicon.png`, // This path is relative to the root of the site.
      },
    },
    `gatsby-plugin-gatsby-cloud`,
    {
      resolve: `gatsby-plugin-typescript`,
      options: {
        isTSX: true,
        allExtensions: true,
      },
    },
    {
      resolve: "gatsby-source-storyblok",
      options: {
        accessToken: `${process.env.STORYBLOK_PREVIEW_ACCESS_KEY}`,
        version: `${process.env?.STORYBLOK_VERSION ?? "draft"}`,
      },
    },
    // this (optional) plugin enables Progressive Web App + Offline functionality
    // To learn more, visit: https://gatsby.dev/offline
    // `gatsby-plugin-offline`,
    {
      // Using SENTRY_DSN environment variable to populate DSN
      resolve: "@sentry/gatsby",
      options: {
        sampleRate: 0.7,
        environment: process.env.SENTRY_ENVIRONMENT || activeEnv,
      },
    },
  ],
}

this is my package.json

{
  "name": "web",
  "private": true,
  "description": "website",
  "version": "0.1.0",
  "author": "Simon",
  "dependencies": {
    "@apollo/client": "3.10.5",
    "@loadable/component": "^5.16.4",
    "@popperjs/core": "^2.11.8",
    "@reach/router": "^1.3.4",
    "@sentry/gatsby": "^7.45.0",
    "@types/googlemaps": "^3.43.3",
    "@types/isomorphic-fetch": "^0.0.35",
    "@types/loadable__component": "^5.13.9",
    "@types/segment-analytics": "^0.0.34",
    "@vimeo/player": "^2.16.1",
    "@yoco/kyc-web-sdk": "^1.0.10",
    "apollo-upload-client": "^16.0.0",
    "aws-amplify": "^4.2.9",
    "dotenv": "^16.4.5",
    "gatsby": "^3.13.0",
    "gatsby-plugin-gatsby-cloud": "^2.11.0",
    "gatsby-plugin-image": "^1.14.0",
    "gatsby-plugin-manifest": "^3.13.0",
    "gatsby-plugin-offline": "^4.13.0",
    "gatsby-plugin-react-helmet": "^4.13.0",
    "gatsby-plugin-sass": "^4.14.0",
    "gatsby-plugin-sharp": "^3.13.0",
    "gatsby-plugin-styled-components": "^6.13.1",
    "gatsby-plugin-typescript": "^3.13.0",
    "gatsby-source-filesystem": "^3.13.0",
    "gatsby-source-storyblok": "^3.0.1",
    "gatsby-transformer-sharp": "^3.13.0",
    "isomorphic-fetch": "^3.0.0",
    "jwt-decode": "^3.1.2",
    "prop-types": "^15.8.1",
    "query-string": "^9.0.0",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-helmet": "^6.1.0",
    "react-masonry-css": "^1.0.16",
    "react-popper": "^2.3.0",
    "react-use-localstorage": "^3.5.3",
    "sass": "^1.77.6",
    "styled-components": "^6.0.0",
    "swiper": "^7.0.8",
    "ts-invariant": "^0.10.3"
  },
  "devDependencies": {
    "@cypress/mount-utils": "^2.1.0",
    "@reduxjs/toolkit": "^1.6.1",
    "@sentry/webpack-plugin": "^1.20.0",
    "@types/react-dom": "^17.0.9",
    "@types/react-helmet": "^6.1.2",
    "@types/styled-components": "^5.1.34",
    "@typescript-eslint/eslint-plugin": "^6.7.5",
    "@typescript-eslint/parser": "^6.7.5",
    "babel-plugin-styled-components": "^1.13.2",
    "clsx": "^1.1.1",
    "cypress": "^10.10.0",
    "eslint": "^7.32.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-import-resolver-typescript": "^3.3.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-react": "^7.25.1",
    "eslint-plugin-react-hooks": "^4.2.0",
    "formik": "^2.2.9",
    "husky": "^7.0.2",
    "lint-staged": "^11.1.2",
    "prettier": "^2.3.2",
    "react-redux": "^7.2.5",
    "typescript": "^5.2.2",
    "yup": "^0.32.9"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "0BSD",
  "scripts": {
    "cy-run": "cypress run",
    "cy-open": "cypress open",
    "build": "gatsby build",
    "develop": "GATSBY_ACTIVE_ENV=local gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1",
    "prepare": "husky install",
    "lint": "eslint \"**/*.{js,jsx,ts,tsx,json,md}\""
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  },
  "lint-staged": {
    "*.{js,ts,tsx,jsx}": "eslint --fix",
    "*.{js,ts,tsx,jsx,md,json}": "prettier --write"
  }
}

Reproduction

N/A

Steps to reproduce

yarn build

System Info

System:
    OS: macOS 13.5.1
    CPU: (8) arm64 Apple M1
    Memory: 125.41 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.3 - ~/.nvm/versions/node/v18.20.3/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v18.20.3/bin/npm
    Watchman: 2023.07.24.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 126.0.6478.63
    Edge: 126.0.2592.68
    Safari: 16.6

Used Package Manager

yarn

Error logs (Optional)

No response

Validations

@nseokaneJHB nseokaneJHB added pending-author [Issue] Add Storyblok employee pending-triage [Issue] Add labels to describe it or prioritise it labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Add Storyblok employee pending-triage [Issue] Add labels to describe it or prioritise it
Projects
None yet
Development

No branches or pull requests

1 participant