Gatsby-source-ghost: Invalid flags supplied to RegExp constructor gs

Hi all,

I’m trying to build a Gatsby side using TryGhost/gatsby-starter-ghost. I’ve encountered a problem while running gatsby develop:

ERROR #11321 PLUGIN

“gatsby-source-ghost” threw an error while running the sourceNodes lifecycle:

Invalid flags supplied to RegExp constructor ‘gs’

Gatsby still built fine, but I can get everything(title, menus, tags, authors…) except my posts.

Before changing the .ghost.json it fetched well, but it doesn’t fetch well after changing to my apiUrl and contentApiKey.

Ghost version 3.2.0.
Here’s my dependencies in package.json:

“dependencies”: {
@tryghost/helpers”: “1.1.19”,
@tryghost/helpers-gatsby”: “1.0.22”,
“cheerio”: “1.0.0-rc.3”,
“gatsby”: “2.17.15”,
“gatsby-awesome-pagination”: “0.3.5”,
“gatsby-image”: “2.2.33”,
“gatsby-plugin-advanced-sitemap”: “1.4.5”,
“gatsby-plugin-catch-links”: “2.1.17”,
“gatsby-plugin-feed”: “2.3.21”,
“gatsby-plugin-force-trailing-slashes”: “1.0.4”,
“gatsby-plugin-manifest”: “2.2.28”,
“gatsby-plugin-offline”: “3.0.21”,
“gats by-plugin-react-helmet”: “3.1.15”,
“gatsby-plugin-sharp”: “2.3.1”,
“gatsby-source-filesystem”: “2.1.37”,
“gatsby-source-ghost”: “4.0.3”,
“gatsby-transformer-sharp”: “2.3.5”,
“lodash”: “4.17.15”,
“react”: “16.12.0”,
“react-dom”: “16.12.0”,
“react-helmet”: “5.2.1”
}

I’m new to use gatsby-starter-ghost. Thanks in advance.

I have found some additional information here.

The solution is that editing the file ghost/versions/3.2.0/node_modules/@tryghost/url-utils/lib/utils/html-relative-to-absolute.js, and change the 'gs' to 'g'.

Now it’s working. I’m worndering if it’s a problem, maybe creating a issue on GitHub?