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

[gatsby-plugin-typography] Error : No such file or derectory .cache/typography.js #1669

Closed
muhajirdev opened this issue Aug 1, 2017 · 9 comments

Comments

@muhajirdev
Copy link
Contributor

muhajirdev commented Aug 1, 2017

Here's the error

muhajir@muhammad:~/clients/makapala.org$ gatsby develop
success open and validate gatsby-config.js — 0.030 s
success copy gatsby files — 0.156 s
⠂ source and transform nodes/home/muhajir/clients/makapala.org/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

Error: ENOENT: no such file or directory, open '/home/muhajir/clients/makapala.org/node_modules/gatsby-plugin-typography/.cache/typography.js'
    at Object.fs.openSync (fs.js:652:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    ...

And this is my gatsby-config.js

module.exports = {
  siteMetadata: {
    title: `Makapala Official Website`,
  },
  plugins: [`gatsby-plugin-react-helmet`, `gatsby-plugin-typography`]
}

package json :

{
  "name": "gatsby-starter-default",
  "description": "Gatsby default starter",
  "version": "1.0.0",
  "author": "Muhammad Muhajir <muhajirfrae@gmail.com>",
  "dependencies": {
    "gatsby": "^1.0.1",
    "gatsby-link": "^1.0.1",
    "gatsby-plugin-react-helmet": "^1.0.1",
    "gatsby-plugin-typography": "^1.6.0",
    "glamor": "^2.20.37",
    "glamorous": "^3.25.0",
    "gsap": "^1.20.2",
    "react-anime": "^0.3.4",
    "react-gsap-enhancer": "^0.3.0",
    "react-transition-group": "^2.2.0",
    "typography": "^0.15.12"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "main": "n/a",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
    "prettier": "^1.5.2"
  }
}

@KyleAMathews
Copy link
Contributor

Fixed in #1670 and released in 1.6.1. Thanks for the report! I just released it an hour or so ago haha so thanks for being the guinea pig.

@muhajirdev
Copy link
Contributor Author

hi @KyleAMathews , I tried to update. And start new project with gatsby new.
And i got this error when gatsby develop

Error: ./~/gatsby-plugin-typography/.cache/typography.js
Module parse failed: /home/muhajir/clients/makapala.org/node_modules/gatsby-plugin-typography/.cache/typography.jsUnexpected token (3:15)

@sgoudie
Copy link
Contributor

sgoudie commented Aug 1, 2017

+1 getting that error following the gatsby tutorial:

Error: ./~/gatsby-plugin-typography/.cache/typography.js
Module parse failed: [...]tutorial-part-two/node_modules/gatsby-plugin-typography/.cache/typography.js Unexpected token (3:15)

@KyleAMathews
Copy link
Contributor

Grrr... sorry folks, testing again.

@KyleAMathews
Copy link
Contributor

1.6.2 is out with fix.

@sgoudie
Copy link
Contributor

sgoudie commented Aug 2, 2017

Works for me, thanks @KyleAMathews 🙌

@jorissparla
Copy link

following the tutorial, getting error Module parse failed: C:\Users\jsparla\Dropbox\dev\MyHomePage\node_modules\gatsby-plugin-typog raphy.cache\typography.js Bad character escape sequence (1:71)
You may need an appropriate loader to handle this file type.
SyntaxError: Bad character escape sequence (1:71)
"dependencies": {
"gatsby": "^1.8.1",
"gatsby-link": "^1.6.5",
"gatsby-plugin-glamor": "^1.6.1",
"gatsby-plugin-styled-components": "^1.0.1",
"gatsby-plugin-typography": "^1.7.2"
}

@kylegalbraith
Copy link
Contributor

I am trying to run the "Part Three" tutorial locally on a windows box and I am getting the following error:

info bootstrap finished - 2.489 s

error There was error compiling the entry index.html use to host the development site.

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND

  Error: Module parse failed: C:\Users\Kyle\node_modules\gatsby-plugin-typography\.cache\typography.js   Bad character escape sequence (1:90)
  You may need an appropriate loader to handle this file type.
  SyntaxError: Bad character escape sequence (1:90)

Any tips on how to resolve this? gatsy-cli --version 1.0.9

@KyleAMathews
Copy link
Contributor

The character escape sequence thing is a different error than the original that only affects windows machines…

If you want to look into fixing this, the code is here: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-typography/src/gatsby-node.js#L11

Probably the fix is to just trim off the line endings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants