bagseye / barcadia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Develop fail

ibragimof opened this issue · comments

I'm new in Gatsby.
While running gatsby develop all images except one of them (blogs page cover "iphone-camera.jpg") are missed.
All demo pictures in images folder are there. But while generating its missing.
How can I assign images?

What is the error you are getting, I am testing the build locally and getting no issues.

There is no error in bash. Oly in Chrome Browser Dev.tools ('console' tab) says a lot errors about images processing. Here is one of them:
No data found for image "../../images/macbook-color.jpg" undefinedCould not read image data file "D:\_host\open-server_actual\domains\daad\.cache\caches\gatsby-plugin-image\672271478.json". This may mean that the images in "D:\_host\open-server_actual\domains\daad\src\components\BannerModule\BannerModule.js" were not processed. Please ensure that your gatsby version is at least 2.24.78.

What does the terminal return when you run gatsby -v

Gatsby CLI version: 4.3.0 Gatsby version: 2.19.38

The last part of the error refers to the version of Gatsby - Please ensure that your gatsby version is at least 2.24.78

Can you run npm install -g gatsby-cli and try it again. I am not getting the errors you are getting so I assume updating your Gatsby CLI version should do the trick

Thanks. Solved:

  1. run npm outdated
  2. manually upgrade all dependencies which are require upgrade (in my case npm install gatsby@latest --legacy-peer-deps)

For clarification: while trying to develop in Netlify ('new site from Git') option - again got error. Can you tell me how can I send access tokens from .env.production file to Gatsby environment? (I've already add this file to repository by removing its name from gitingnore)

Netlify deploy output:

10:54:54 PM: error Invalid plugin options for "gatsby-source-contentful":
10:54:54 PM: - "accessToken" is required
10:54:54 PM: - "spaceId" is required
10:54:54 PM: not finished open and validate gatsby-configs, load plugins - 1.016s
10:54:54 PM: npm ERR! code ELIFECYCLE
10:54:54 PM: npm ERR! errno 1
10:54:54 PM: npm ERR! barcadia@0.1.0 build: gatsby build
10:54:54 PM: npm ERR! Exit status 1
10:54:54 PM: npm ERR!
10:54:54 PM: npm ERR! Failed at the barcadia@0.1.0 build script.
10:54:54 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:54:54 PM: npm ERR! A complete log of this run can be found in:
10:54:54 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-12-05T17_54_54_600Z-debug.log
10:54:54 PM: ​
10:54:54 PM: ────────────────────────────────────────────────────────────────
10:54:54 PM: "build.command" failed
10:54:54 PM: ────────────────────────────────────────────────────────────────
10:54:54 PM: ​
10:54:54 PM: Error message
10:54:54 PM: Command failed with exit code 1: npm run build
10:54:54 PM: ​
10:54:54 PM: Error location
10:54:54 PM: In Build command from Netlify app:
10:54:54 PM: npm run build
10:54:54 PM: ​
10:54:54 PM: Resolved config
10:54:54 PM: build:
10:54:54 PM: command: npm run build
10:54:54 PM: commandOrigin: ui
10:54:54 PM: publish: /opt/build/repo/public
10:54:54 PM: publishOrigin: ui

Have you setup your environment variables in Netlify?

Thanks again!
After setting up it builds correctly.