Comments (9)
I know this is quite a few months old but for someone else who might run into this issue I was able to solve it by adding a .env
file and setting the WORDPRESS_URL=
there.
from gridsome-starter-wordpress.
I'm having this same issue
from gridsome-starter-wordpress.
Hi @simduchaine
Can you please provide your gridsome.config
?
I had the same error but I was giving the wrong baseUrl
for my local Wordpress environment.
from gridsome-starter-wordpress.
@Alligatore3 Here's my gridsome.config.js
:
module.exports = {
siteName: "Gridsome",
siteDescription: "A WordPress starter for Gridsome",
plugins: [
{
use: "@gridsome/source-wordpress",
options: {
baseUrl: process.env.WORDPRESS_URL, // required
apiBase: "wp-json",
typeName: "WordPress",
perPage: 10,
concurrent: 0,
routes: {
post: "/:year/:month/:day/:slug",
post_tag: "/tag/:slug"
}
}
}
]
};
And here's my ENV variable:
[template.environment] WORDPRESS_URL = "https://voyage.simonduchaine.com"
Note that I'm trying to fetch a live prod website not a local wordpress env.
from gridsome-starter-wordpress.
@simduchaine
I'm not an expert with node env but I'm pretty sure that if you put your_path
directly inside gridsome.config.js
it works.
I tried with my remote env, I put my URL like this:
options: { baseUrl: 'https://voyage.simonduchaine.com', // required
Actually I got another error 😅 but at least not this one.
from gridsome-starter-wordpress.
@Alligatore3 tried your suggestion, didn't get the ERCONNREFUSED
but still, the issue is almost the same as now it's Graphql throwing a error 500
(try the gridsome explore
command and you'll see).
from gridsome-starter-wordpress.
I know this is quite a few months old but for someone else who might run into this issue I was able to solve it by adding a
.env
file and setting theWORDPRESS_URL=
there.
What is the exact file name for the .env
file you added? Is it just .env.json
in root?
from gridsome-starter-wordpress.
I know this is quite a few months old but for someone else who might run into this issue I was able to solve it by adding a
.env
file and setting theWORDPRESS_URL=
there.What is the exact file name for the
.env
file you added? Is it just.env.json
in root?
The exact file name is .env
it is called a dotfile. And yes you just put it at the root dir.
from gridsome-starter-wordpress.
Using this theme as is, gridsome build
fails when building the site on Netlify.
I thought, inside the netlify.toml
file, the WORDPRESS_URL
value should be set to the exact one specified in my .env
file. However, that's not the case. (I'd appreciate some explanation why this fails. BTW, I also tried adding the exact json endpoint, too. Example: https://portal.mysite.com/wp-json
)
I actually, had to remove the entire [template.environment]
declaration from the netlify.toml
file first.
Remove:
[template.environment]
WORDPRESS_URL = "https://portal.mysite.com"
Then in my Netlify account, goto Settings > Build & Deploy > Environment Variables, add the same credentials from my .env
file.
For example:
Key = WORDPRESS_URL
Value = https://portal.mysite.com
Now it works.
from gridsome-starter-wordpress.
Related Issues (20)
- Cannot query field "url" HOT 3
- Error: Cannot query field "allWordPressPost" on type "Query". Did you mean "allGraphqlPost"? HOT 6
- Failed to fetch baseUrl HOT 9
- Page Template HOT 1
- sourceUrl error HOT 10
- vue-svg-loader giving Error: Cannot query field "allWordPressP ost" on type "Query".
- Failed to make route like WordPress custom permalink
- Can't have pages with children render correctly: routes: { page: ':link', HOT 11
- Updating for v0.7, Routes/Templates HOT 3
- TypeError: Cannot destructure property `status` of 'undefined' or 'null'. HOT 16
- Custom Post Types 'rest_base' starting with '/' HOT 1
- Failed to compile with 2 errors HOT 4
- Use :category as path
- WordPress Multisite support HOT 1
- custom post types support?
- QUESTION: Support for JWT authentication
- Error graphQl run dev
- fails on POST with 400 HOT 3
- Clarification
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridsome-starter-wordpress.