-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: TypeScriptIssues and PRs related to TS in general, public typings or gatsby-plugin-typescriptIssues and PRs related to TS in general, public typings or gatsby-plugin-typescripttype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
This part of the code tries to compile the gatsby-config and seemingly sense check it.
gatsby/packages/gatsby/src/utils/parcel/compile-gatsby-files.ts
Lines 114 to 119 in 0ee492c
// validate that output exists and is valid | |
try { | |
delete require.cache[bundle.filePath] | |
require(bundle.filePath) | |
} catch (e) { | |
if (retry >= RETRY_COUNT) { |
There is a problem that it disregards any errors it receives. This caused a lot of confusion where out gatsby-config.ts
file was doing something like:
// caused an error (missing quote)
const pathPrefix = JSON.parse('{"foo:"bar"}');
const config: GatsbyConfig = {
jsxRuntime: "automatic",
pathPrefix
};
return config;
Instead of logging sensible messages, we get the dreaded: Error: EBUSY: resource busy or locked, unlink 'C:\Users\...\.cache\.parcel-cache\data.mdb'
.
Reproduction Link
https://github.com/gatsbyjs/gatsby/
Steps to Reproduce
- Add the following to gatsby-config.ts:
// caused an error (missing quote)
const pathPrefix = JSON.parse('{"foo:"bar"}');
const config: GatsbyConfig = {
jsxRuntime: "automatic",
pathPrefix
};
return config;
- Run
gatsby dev
...
Expected Result
A clear error message that highlights the problem better (that the gatsby-config.ts threw an error)
Actual Result
Error: EBUSY: resource busy or locked
error message, which is very misleading
Environment
System:
OS: Windows 10 10.0.19044
CPU: (16) x64 AMD Ryzen 9 5950X 16-Core Processor
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 3.2.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.47)
npmPackages:
gatsby: ^4.19.2 => 4.19.2
gatsby-cypress: 2.19.0 => 2.19.0
gatsby-plugin-google-tagmanager: ^4.19.0 => 4.19.0
gatsby-plugin-image: ^2.19.0 => 2.19.0
gatsby-plugin-newrelic: ^2.2.2 => 2.2.2
gatsby-plugin-sharp: ^4.19.0 => 4.19.0
gatsby-plugin-sitemap: ^5.19.0 => 5.19.0
gatsby-plugin-styled-components: ^5.19.0 => 5.19.0
gatsby-plugin-webpack-bundle-analyser-v2: 1.1.27 => 1.1.27
gatsby-source-filesystem: ^4.19.0 => 4.19.0
gatsby-transformer-remark: ^5.19.0 => 5.19.0
gatsby-transformer-sharp: ^4.19.0 => 4.19.0
Config Flags
No response
Metadata
Metadata
Assignees
Labels
status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: TypeScriptIssues and PRs related to TS in general, public typings or gatsby-plugin-typescriptIssues and PRs related to TS in general, public typings or gatsby-plugin-typescripttype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby