gatsby-plugin-typography - Error whilst following Gatsby tutorial.

Created on 26 Feb 2019  路  3Comments  路  Source: gatsbyjs/gatsby

Description

Trying to get up and running with the Typography plugin as per the gatsby tutorial. An error is thrown when I come to run develop.

Steps to reproduce

npm install --save gatsby-plugin-typography react-typography typography

I update my gatsby-config file as per the tutorial.

gatsby develop

Logs

```
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v8.15.0/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 72.0.3626.119
Firefox: 65.0
Safari: 12.0.2
npmPackages:
gatsby: ^2.1.18 => 2.1.18
gatsby-plugin-typography: ^2.2.7 => 2.2.7
npmGlobalPackages:
gatsby-cli: 2.4.11


Error: ./node_modules/gatsby-plugin-typography/gatsby-ssr.js
Module not found: Error: Can't resolve './.cache/typography' in '/Users/jbedford/Documents/GitHub/jabedford/blog/node_modul es/gatsby-plugin-typography'
resolve './.cache/typography' in '/Users/jbedford/Documents/GitHub/jabedford/blog/node_modules/gatsby-plugin-typography'
using description file: /Users/jbedford/Documents/GitHub/jabedford/blog/node_modules/gatsby-plugin-typography/package.jso n (relative path: .)
using description file: /Users/jbedford/Documents/GitHub/jabedford/blog/node_modules/gatsby-plugin-typography/package.j son (relative path: ./.cache/typography)
no extension
/Users/jbedford/Documents/GitHub/jabedford/blog/node_modules/gatsby-plugin-typography/.cache/typography doesn't exist

```

good first issue help wanted documentation

Most helpful comment

Thank you for the report! You need to create a Javascript file for the typography config (default is src/utils/typography.js). Documentation should be improved so that it tells one to do more explicitly (eg adding path on top of typography.js example). Do you want to make a PR to fix the docs?

All 3 comments

Thank you for the report! You need to create a Javascript file for the typography config (default is src/utils/typography.js). Documentation should be improved so that it tells one to do more explicitly (eg adding path on top of typography.js example). Do you want to make a PR to fix the docs?

Docs already have how to create typography.js file and configure it.
https://www.gatsbyjs.org/docs/typography-js/#creating-the-typography-configuration

I see where it is mentioned now. Your right, it needs to be a bit more explicit and point to the link that @yogeshkotadiya shared above.

Yes @freiksenet I'll create a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonmp picture brandonmp  路  3Comments

ferMartz picture ferMartz  路  3Comments

rossPatton picture rossPatton  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments