Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

TypeError: Cannot read property 'tokenizePlaceholders' of undefined #21

Closed
BobWalsh opened this issue Apr 30, 2018 · 3 comments
Closed

Comments

@BobWalsh
Copy link

With gatsby version 1.1.51 did:

gatsby new YourProjectName https://github.com/haysclark/gatsby-starter-casper
npm install # or yarn install
npm run develop # or gatsby develop

and immediately hit:

TypeError: Cannot read property 'tokenizePlaceholders' of undefined

  - prism-php.js:121
    [gatsby-test2]/[prismjs]/components/prism-php.js:121:40

  - prism.js:456 Object.run
    [gatsby-test2]/[prismjs]/prism.js:456:5

  - prism.js:287 Object.highlight
    [gatsby-test2]/[prismjs]/prism.js:287:11 [. . . and 18 other errors.]

Suggestions, pointers or workarounds?

@sasivarnan
Copy link

I was also facing this issue. Removing the php code block in /content/sample-posts/2017-01-01/index.md file resolved this error.

@DarrenCook
Copy link

Failed idea: I tried yarn upgrade prismjs@1.13.0 (i.e. downgrade from 1.14.0). That made no difference.

Deleting the 2017-01-01 folder that sasivarnan described, does seem to get past it, but then stops on GraphQLError: Cannot query field "author" on type "frontmatter". (it is then doing "createPages" for a long time.) But these might be unrelated problems?

haysclark added a commit that referenced this issue May 1, 2018
Users installing the project with Yarn were missing a critical child dependancies for prismjs@1.9.0.

Resolves #21
@haysclark
Copy link
Owner

@BobWalsh Great catch and I'm very sorry about this issue. This issue was my fault for not including the yarn.lock with the project. As time has gone on a sub-dependency of gatsby-remark-prismjs (prismjs) has slowly been upgraded. Users that used npm install missed this issue, but that meant that the README.md file was not incorrect. I have updated the repo so that Yarn users will get the needed prismjs@1.9.0 dependancy. Because the issue is caused by a sub-dependancy, you'll likely have better luck if you replace your current yarn.lock file with the new version. Running yarn upgrade prismjs@1.9.0 will not fix the issue. Additionally, you will need to delete your public and .cache folders. You can do this by running npm run clean.

Hope that helps!

soul-wish added a commit to soul-wish/gatsby-starter-casper that referenced this issue Feb 8, 2019
* fix: re-adding Disqus support

enable Disqus comments in posts by providing a ‘disqusShortname’ in the SiteConfig.js.

Resolved haysclark#9

* chore(release): 1.0.4

* fix: adding basic validation for authors

Adding build time error to warn users if ‘authors’ folder is missing and improving posts and authors content documentation.
Resolves haysclark#10

* fix: fixing sample-post dates and folder names

Posts now to have YEAR-MONTH-DAY formatting, allowing GraphQL to sort them correctly.  Post folder names corrected to match the date in each .md file.

* perf: removing dead GraphQL query

* chore(release): 1.0.5

* fix: improving npm ‘clean’ script to wipe .cache

Sometime Gatsby does not clear the .cache folder which can lead to confusion. Running ‘npm clean’, will now delete both public and .cache to aid in resolving this issue.

* fix: fixing MainNav rendering

Adding missing ‘overlay’ and ‘clearfix’ CSS classes to MainNav to resolve render issue when no Cover image is provided.
Updating Big-Sample-Post to have no cover for validation

Resolves haysclark#18

* chore(release): 1.0.6

* fix: adding yarn.lock to fix install issues

Users installing the project with Yarn were missing a critical child dependancies for prismjs@1.9.0.

Resolves haysclark#21

* chore(release): 1.0.7

* chore: updating README with more specific install steps

* added import for prismjs css file to fix missing syntax highlighting

* fix: Adding local image for post cover example

Resolves haysclark#17

* chore: updating package-lock.json

* fix: ignoring linting error

- due to Prisma being added for Gatsby 2.0 support, we are ignoring this minor issue

* chore(release): 1.0.8

* BREAKING CHANGE: installed latest gatsby version [2.0.20]

* chore: updating yarn.lock

* refactor: installing retaled package updates

* refactor: missing 'prismjs' package needed for 'gatsby-transformer-remark' in v2

* refactor: change .babelrc to gatsby default

* refactor: moved layouts to components updated relative imports

* refactor: renamed index.jsx to layout.jsx and moved to components folder

* refactor: wrapped template pages without layout component

* refactor: changed 'children()' to 'children' in layout.jsx

* refactor: pass location to Layout component in all templates

* refactor: renamed id property of authors to uid | id seems to be a special proberty of nodes and messing with it breaks queries

* refactor: deprecated gatsby-link | removed package and updated imports

* refactor: explicit import of graphql tag

* refactor: Rename boundActionCreators to actions

* refactor: Rename pathContext to pageContext

* refactor: Change modifyWebpackConfig to onCreateWebpackConfig

* docs: Updating to reflect Gatsby 2.0 support

* chore: linting JS and most component CSS errors

- avoiding changes to layout.css for now

* chore(release): 2.0.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants