Gatsby: Windows build fails with special characters in path

Created on 16 Mar 2018  ·  8Comments  ·  Source: gatsbyjs/gatsby

Description

Builds will fail on Windows for paths that contain non-[a-zA-Z0-9] characters such as ä, ö, ü.

Refs #3183 @anttti @LeKoArts

Steps to reproduce

  • On a Windows PC
  • Create a Gatsby project in a folder who's path contains characters like ä, ö, ü
  • Run gatsby build

Expected result

The site should build

Actual result

The site errors with:

error UNHANDLED REJECTION

  TypeError: Cannot read property 'jsonName' of undefined

Environment

  • Operating System: Windows
help wanted bug

Most helpful comment

👍 cool — just closed 400 so might have closed a few that shouldn't have.

All 8 comments

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

@KyleAMathews Don’t understand why this one is closed... It’s still a bug at least 6 people had and it just wasn’t solved by anyone until now

👍 cool — just closed 400 so might have closed a few that shouldn't have.

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

I am seeing different issue related to GraphQL:

The GraphQL query from C:/dev/sandbox/path-with-ä-ру/src/components/image.js failed.

Errors:
  Syntax Error: Cannot parse the unexpected character "\u0420".

  GraphQL request:1:27
  1 | query cDevSandboxPathWithAРуSrcComponentsImageJs2969191536 {
    |                           ^
  2 |   placeholderImage: file(relativePath: {eq: "gatsby-astronaut.png"}) {
Plugin:
  none
Query:
  query cDevSandboxPathWithAРуSrcComponentsImageJs2969191536 {
    placeholderImage: file(relativePath: {eq: "gatsby-astronaut.png"}) {
      childImageSharp {
        fluid(maxWidth: 300) {
          ...GatsbyImageSharpFluid
        }
      }
    }
  }

  fragment GatsbyImageSharpFluid on ImageSharpFluid {
    base64
    aspectRatio
    src
    srcSet
    sizes
  }

Feels like we need to slugify the query name. Does that sound right @vladar ?

Yep, do we use any library for this already? Or maybe you have one in mind?

Should be fixed in gatsby 2.17.17

Was this page helpful?
0 / 5 - 0 ratings