question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gridsome develop command fail when Contentful Entry title field contains only Japanese.

See original GitHub issue

Description

gridsome develop command fail when Contentful Entry title field contains only Japanese.

Steps to reproduce

commands

  • gridsome create <project>
  • yarn add @gridsome/source-contentful
  • yarn develop

Contentful Model

スクリーンショット 2019-03-22 23 08 23

Entity example

  • title: ‘テスト’
  • article: ‘test article’

Expected result

  • successfully compiled.

Actual result

  • error happened
fuuki@23:00:52 fuuki-blog $ yarn develop
yarn run v1.15.2
$ gridsome develop
Gridsome v0.5.5

Initialize - 0.19s
TypeError: Expected "slug" to match "[^\/]+?", but got ""
    at Object.createPath (/Users/shigenaka/Documents/GitHub/fuuki-blog/node_modules/path-to-regexp/index.js:180:17)
    at ContentTypeCollection._createPath (/<project-dir>/node_modules/gridsome/lib/app/ContentTypeCollection.js:309:25)
    at ContentTypeCollection.addNode (/<project-dir>/node_modules/gridsome/lib/app/ContentTypeCollection.js:76:14)
    at ContentfulSource.getEntries (/<project-dir>/node_modules/@gridsome/source-contentful/index.js:88:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Environment

  • Dependencies
  "dependencies": {
    "@gridsome/source-contentful": "^0.2.1",
    "gridsome": "^0.5.0"
  }

my awareness

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ion1commented, Mar 23, 2019

I don’t know the best solution, but Unidecode is one option to generate very rough ASCII transliterations of any text.

> require('unidecode')('テスト')
'tesuto'
0reactions
fuukicommented, Mar 25, 2019

Thank you so much! In my model, this code behave fine.

  use: '@gridsome/source-contentful',
  options: {
    routes: {
      Blog: '/blog/:id' // or any other field
    }
  }

However, slugify titles can cause failed builds to non-English titles, so I recommend to use an id for slug (or route) in the route configuration by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors | Contentful
HTTP status code Error code Description 401 Unauthorized AccessTokenInvalid The authorization token was invalid. 422 Unprocessable Entity UnknownField The triggered query references an unknown... 422 Unprocessable...
Read more >
gridsome/source-contentful
Contentful source for Gridsome. ... I start a new [Gridsome](https://gridsome.org) project, I have to go and set up SVG inlining. It's annoying having...
Read more >
Syntax - Tasty Web Development Treats - Podcast Addict
Syntax - Tasty Web Development Treats - via Podcast Addict | Full Stack Developers Wes Bos and Scott Tolinski dive deep into web...
Read more >
Remote API + Mobile + Security Jobs with great benefits and pay
... to $70000/year working as a Provider Referral Coordinator, Senior Customer Success Manager or Senior Software Developer FinTech. Last post 17 days.
Read more >
Continue: Error Cleartext Not Permitted Android Studio - Scribd
Make sure that the path and file name are correct. catch (ArgumentNullException) ... in postman brute task manager mac chrome.debugger.sendcommand Input.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found