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

Changes to Typography.js aren't applied without server restart #9095

Closed
talolard opened this issue Oct 14, 2018 · 2 comments · Fixed by #10545
Closed

Changes to Typography.js aren't applied without server restart #9095

talolard opened this issue Oct 14, 2018 · 2 comments · Fixed by #10545
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@talolard
Copy link
Contributor

Description

When following tutorial 2, line 240 implies we should be able to make a change to typography.js configuration and see the changes immediately.

This has not been working for us when following tutorial 2.

Additioanlly, we've tried "gatsby new " with the default starter, disabling layout.css and then configuring typography.js but the problem persists.

If we restart the gatsby server the new changes take effect.

Notably, if we look at the console output of the development server, nothing is emmited when we alter typography.js (where we configure typography). Perhaps it is being ignored by some watcher ?
Also, if we hotswap themes instead of hand crafted styled, the changes do take effect

Steps to reproduce

Follow the second part of the tutorial upto here.

Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue much easier to diagnose (seriously).

Expected result

When changing

src/utils/typography.js
import Typography from "typography"

const typography = new Typography({ baseFontSize: "18px" })

export default typography

to

src/utils/typography.js
import Typography from "typography"

const typography = new Typography({ baseFontSize: "24px" })

export default typography

Fonts should get bigger

Actual result

Everything stays the same

Environment

System:
OS: Linux 4.15 Ubuntu 16.04.3 LTS (Xenial Xerus)
CPU: x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
Shell: 4.3.48 - /bin/bash
Binaries:
Node: 10.10.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 62.0.3202.94
Firefox: 62.0.3
npmPackages:
gatsby: ^2.0.19 => 2.0.19
gatsby-plugin-manifest: ^2.0.5 => 2.0.5
gatsby-plugin-offline: ^2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0
gatsby-plugin-typography: ^2.2.0 => 2.2.0
npmGlobalPackages:
gatsby-cli: 2.4.2

@LekoArts
Copy link
Contributor

See if this works:
https://github.com/LeKoArts/gatsby-starter-minimal-blog/blob/master/src/utils/typography.js#L26

talolard added a commit to talolard/gatsby that referenced this issue Oct 14, 2018
Per gatsbyjs#9095, the way the tutorial is set up, hot reloading of typography.js doesn't work without the extra lines I added (credit to @LekoArts ). Newcomers like myself expect that it will hotreload because the tutorial implies it does, and also, I think, it's the "Gatsby  way"
@pieh pieh added the type: question or discussion Issue discussing or asking a question about Gatsby label Oct 15, 2018
@matteocarpi
Copy link

Hello!

I'm reproducing the same issue but no luck even adding that line of code.

any idea of what I might be getting wrong?

https://github.com/matteocarpi/tutorial-part-two

thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
4 participants