gatsby-starter | Gatsby 2.0 starter with typescript and many cools
kandi X-RAY | gatsby-starter Summary
kandi X-RAY | gatsby-starter Summary
Gatsby 2.0 starter with typescript and many cools dev tools
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-starter
gatsby-starter Key Features
gatsby-starter Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-starter
QUESTION
I am trying to set up my first Gatsby website. After running npm install -g gatsby-cli
, I do gatsby new gatsby-starter-hello-world https://github.com/gatsbyjs/gatsby-starter-hello-world
(just like the website https://www.gatsbyjs.com/starters/gatsbyjs/gatsby-starter-hello-world/ says) to download the hello world starter. When I run gatsby develop
I see the following error
ANSWER
Answered 2022-Mar-21 at 06:34As has been commented in the comments section, the issue has been solved by moving the project folder outside the OneDrive directory.
Because it's a synchronized cloud folder, as soon as you install/add/delete/update anything, it's being updated in the OneDrive cloud so the file/folder it's being used in the background and potentially unreachable. If at this time you try to develop the project (gatsby develop
or gatsby build
) and the file is being used, you won't be able to run it.
I don't think it's a good practice to use a cloud folder because the amount of data synchronized (mainly because of the node_modules
) it's something to care about (it's also ignored in the .gitignore
for a reason) so moving it to any other folder outside the OneDrive directory should be enough to run your project because the rest of global dependencies, according to your logs, were successfully installed.
QUESTION
I'm making a Gatsby blog as a side project.
I want to use the "featureImage" optional field in mdx frontmatter.
I tried to refer to the https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization#creating-type-definitions document according to the error message, but it was difficult to understand.
This is part of my code.
index.js
...ANSWER
Answered 2022-Mar-15 at 16:54You may find this GitHub thread insightful. Following it, try using:
QUESTION
I'm getting the below error, trying to import ThemeToggler from gatsby-plugin-dark-mode
...ANSWER
Answered 2022-Feb-17 at 08:33You can simply do : npm i gatsby-plugin-dark-mode --force
QUESTION
I'm very new Gatsbyjs user. Currently I use this template
https://www.gatsbyjs.com/starters/netlify-templates/gatsby-starter-netlify-cms
My nodejs version is v16.13.2
I could "gatsby develop" but I think when I'm adjusting photo data in "page-data.json" which stored public\page-data\index I "gatsby develop" won't start
I'm not sure what is cause but I'm sure when I add some image data into public\img and changed lines "coffee.png" in "page-data.json" this happened...
Here is error message. Could someone teach me what part should I fix please ?
...ANSWER
Answered 2022-Feb-01 at 08:54I could "gatsby develop" but I think when I'm adjusting photo data in "page-data.json" which stored public\page-data\index I "gatsby develop" won't start
You should never edit manually the content or the code inside the /public
folder directly. Keep in mind how Gatsby works: when you run gatsby develop
or gatsby build
, webpack compiles and bundles everything under /src
folder to create the /public
one: this is autogenerated and it is rebuilt when you change anything on your /src
folder. If you change anything inside the public folder manually without changing the source, it will be lost in the next compilation because the source doesn't includes the changes. So, all changes must be done in the /src
folder.
In this case, the error is rising because you changed the public folder directly so the references of the assets page-data.json
have changed.
To change the coffee.png
image, you need to change the static folder. The static folder is a "special" folder that is cloned inside the public folder keeping the exact internal structure. As the name suggests, is very useful to use for static assets (the ones that rarely change).
Once you change the coffe.png
image for your desired one, you just need to change the references of coffee.png
to the new one (unless they are called the same).
That said, this kind of static change may force you to reload the gatsby develop
(stop and rerun) process to see the changes. If the image still without changing, clean the cache by running gatsby clean
before rerunning the gatsby develop
command.
QUESTION
After migrating from Remark to MDX, my builds on Netlify are failing.
I get this error when trying to build:
...ANSWER
Answered 2022-Jan-08 at 07:21The problem is that you have Node 17.2.0. locally but in Netlify's environment, you are running a lower version (by default it's not set as 17.2.0). So the local environment is OK, Netlify environment is KO because of this mismatch of Node versions.
When Netlify deploys your site it installs and builds again your site so you should ensure that both environments work under the same conditions. Otherwise, both node_modules
will differ so your application will have different behavior or eventually won't even build because of dependency errors.
You can easily play with the Node version in multiple ways but I'd recommend using the .nvmrc
file. Just run the following command in the root of your project:
QUESTION
I was following Strapi's Quick Start Guide where you can use a starter to create a project with Gatsby by running:
...ANSWER
Answered 2021-Oct-12 at 06:36I think you need to install the peer dependencies due some mismatching between versions.
For example, React needs to be between ^15.0.0
and ^16.0.0
and found a 17.0.2
:
QUESTION
Currently I am having trouble having gatsby build my HTML renderer due to my poor config knowledge. I tried finding examples online of configs and read the documentation but can't seem to get the order right here.
...ANSWER
Answered 2021-Sep-12 at 09:05You are mixing configurations between gatsby-node.js
and gatsby-config.js
. webpack-related configuration must be placed in gatsby-node.js
while all plugin-related stuff must be placed in gatsby-config.js
. Your final configuration should look like this:
In your gatsby-node.js
:
QUESTION
I've been working with a Gatsby repo and I noticed that on some occasions if not all of the time when I call window, my deployment will fail with the following error
...ANSWER
Answered 2021-Aug-28 at 11:12As you can see in Adding a Custom webpack Config docs, stage
value can mutate through:
develop: when running the
gatsby develop
command. Has configuration for hot reloading and CSS injection into pagedevelop-html: same as develop but without react-hmre in the babel config for rendering the HTML component.
build-javascript: production JavaScript and CSS build. Creates route JavaScript bundles as well as common chunks for JavaScript and CSS.
build-html: production build static HTML pages
So, yes, as you pointed, adding a simple condition should work to set the process/browse
like:
QUESTION
I've tried deploying my Gatsby site to Netlify, but I keep getting these errors for various node modules whenever I try to deploy. I've tried making a webpack.config.js file and including both of the suggested solutions to no avail. I've also tried using alias instead of fallback, adding a browser section to the package.json file which sets the modules to false, and adding a target property in the webpack.config.js file as some other stackoverflow answers have suggested, but I'm still pretty stuck. I don't have any prior experience to webpack and have been doing my best to look for answers. Is there some sort of special configuration for this with Gatsby that I'm missing?
Error message
...ANSWER
Answered 2021-Aug-23 at 04:55In Gatsby, you can't define the webpack configuration like you did because Gatsby ships its own webpack.config.js
as you can read in Gatsby's glossary.
However, Gatsby allows you to add a custom webpack configuration by exposing onCreateWebpackConfig
method in your gatsby-node.js
file.
So:
QUESTION
I am using a gatsby starter gatsby-theme-carbon. It has a switcher component whose code is available here. It looks like this Switcher screenshot.
How do I disable the Switcher completely using component shadowing ? ( i.e. I don't want the Switcher at all in my website).
Thanks in advance for the help.
...ANSWER
Answered 2021-Jun-05 at 09:50As you can see in Shadowing in Gatsby themes docs:
This feature allows users to replace a file in the
src
directory that is included in the webpack bundle with their own implementation. This works for React components, pages insrc/pages
, JSON files, TypeScript files, as well as any other imported file (such as.css
) in your site.
The shadowing API uses a deterministic file structure approach to know which component should or shouldn't be rendered. In your case, you just can override the CSS props
to display it as none, or you just shadow and return an empty component, since shadowing is used to extend Gatsby themes. Create a src/gatsby-theme-blog/components/Switcher/Switcher.js
in your project and do something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-starter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page