Open Szulerinio opened 2 years ago
adding empty gatsby-config.js
file allows the project to build.
That said I am not sure if the config will be applied as it's my first time using gatsby so I would do:
changing gatsby-config.ts
to gatsby-config.js
and its content
from:
import type { GatsbyConfig } from "gatsby";
const config: GatsbyConfig = {
siteMetadata: {
title: `test`,
siteUrl: `https://www.yourdomain.tld`
},
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense.
// If you use VSCode you can also use the GraphQL plugin
// Learn more at: https://gatsby.dev/graphql-typegen
graphqlTypegen: true,
plugins: ["gatsby-plugin-sass"]
};
export default config;
to:
module.exports = {
siteMetadata: {
title: `test`,
siteUrl: `https://www.yourdomain.tld`,
},
graphqlTypegen: true,
plugins: ["gatsby-plugin-sass"]
};
in tsconfig.json
changing gatsby-config
extension .ts
to .js
example
"include": [
"./src/**/*",
"./gatsby-node.ts",
"gatsby-config.ts",
"./plugins/**/*"
]
to
"include": [
"./src/**/*",
"./gatsby-node.ts",
"gatsby-config.js",
"./plugins/**/*"
]
Hi @Szulerinio,
I was unable to reproduce this either on your minimal reproduction site or by following "Steps to Reproduce" (with node 18.10.0
& 16
)
The first error you posted above suggests that you named the config as gatsby-config.ts.ts
and you should change that to gatsby-config.js
(.ts
in this case)
ERROR #10124 CONFIG
It looks like you were trying to add the config file? Please rename "gatsby-config.ts.ts" to "gatsby-config.js"
You seem to have two different error messages. Would be better to provide the exact error your running into along with the site that produces the error as minimal repro
I was tinkering with filenames etc when looking for workaround, and I tried changing names of this file, I must have copied messages from one of these logs instead of from original project.
I am sorry for that. In few hours Ill be back home, and will go through steps again and post correct messages.
I had the same repo cloned on my linux laptop, and there was no such issue, so it might be platform dependent, or a result of something else on my windows pc
I've made new project, yet had the same issue.
Then, I've decided reinstall gatsby-cli -g After that both new and yesterday's projects are working correctly, so that must have been some local problem that corrupted the install
Thanks for your response and sorry for the trouble
I got that error again, from my few tries it happens when path to the project contains "(" and ")" symbol
I ran npm run develop inside Desktop\Nowy folder (2)\gatsby\project
and got that error again
I ran gatsby clean, changed directory name to Desktop\Nowy folder2\gatsby\project
and ran develop again, this time it worked
After that, I ran gatsby clean again, changed back the directory name and got that error again
Tried few more times, and I didn't encounter the error if I didn't run gatsby clean after changing directory name to not contain ()
Ah! Thanks for finding this @Szulerinio!
I can reproduce this on my machine too. There's probably a group of characters asides "()" that will cause this to happen 🤔 But for now I'll update the title and description of this issue to indicate what we know. In https://github.com/gatsbyjs/gatsby/pull/19600, we tried fix issues with special chars in path but this feature came after that — that's probably why we didn't capture this.
Thanks again 💜
Preliminary Checks
Description
Gatsby failed to compile
gatsby-*.ts
to JS when absolute path contains a character like "()"Reproduction Link
https://github.com/Szulerinio/build-test
Steps to Reproduce
In an existing project, rename the site directory to include "()" e.g
"my-site"-> "my-site(1)"Expected Result
Builded, working project with console logs similar to:
Actual Result
Failed build with logs like this:
Environment
Config Flags
No response