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

ADAPT-000: GraphQL error and storyblok-js-client fixup #231

Merged
merged 3 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@ const activeEnv =

console.log(`Using environment config: '${activeEnv}'`);

const siteUrl =
process.env.GATSBY_SITE_URL ||
(process.env.CONTEXT === "production"
? process.env.URL
: process.env.DEPLOY_PRIME_URL);

require("dotenv").config({
path: `.env.${activeEnv}`,
});

// Support for Gatsby CLI
let siteUrl = 'http://localhost:8000';

// Support for Production site builds.
if (process.env.CONTEXT === 'production') {
siteUrl = process.env.URL;
}
// Support for non-production netlify builds (branch/preview)
else if (process.env.CONTEXT !== 'production' && process.env.NETLIFY) {
siteUrl = process.env.DEPLOY_PRIME_URL;
}
// Support for Netlify CLI.
else if (process.env.NETLIFY_DEV === true) {
siteUrl = 'http://localhost:64946';
}

sherakama marked this conversation as resolved.
Show resolved Hide resolved
/**
* Resolve relations for storyblok.
*/
Expand Down Expand Up @@ -115,6 +125,7 @@ module.exports = {
accessToken: process.env.GATSBY_STORYBLOK_ACCESS_TOKEN,
homeSlug: "home",
resolveRelations: storyblokRelations,
resolveLinks: 'url',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While looking at the netlify preview, I found that it has that same weird /default in the Main nav link issue we had on alumni, so I added this bit here, but I'm still seeing that problem on the Netlify preview. @mattanglin or @sherakama do you remember what else we had to do to fix that problem? I believe Nathan also mentioned that he ran into this issue as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yvonnetangsu To fix this we need to manually add the [email protected] (locked to the version) to our package.json. It's a dependency of the gatsby-source-storyblok package, but they published some breaking changes in v4.1.4...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh that was it. Will do. Thanks, @mattanglin !

version: process.env.NODE_ENV == "production" ? "published" : "draft", // show only published on the front end site
// version: 'draft' // would show any including drafts
},
Expand Down
13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"react-slick": "^0.28.1",
"sanitize-html": "^2.3.3",
"slick-carousel": "^1.8.1",
"storyblok-js-client": "4.1.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

"storyblok-react": "^0.1.2",
"tabbable": "^5.2.0",
"trim": "^1.0.1"
Expand Down