-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gatsby-core-utils] update from 1.0.28 to latest causes 3 typescript errors with default export with configstore
and module
dependencies, and gatsby-link
#22070
Comments
I think we fixed this. It was because we forgot to list it as an explicit dependency. Can you update to latest and verify? |
I've updated, and still have same TS issue with yarn lock changes still brings configstore into dependencies: gatsby-telemetry@^1.1.52 has it the only way to fix TS issue for me is adding resolutions package.json
and fixing gatsby and babel-preset-gatsby dependencies to next versions:
sidenote: gatsby-telemetry does not responsible for TS errors, I'm seeing |
Updating to current version gatsby 2.19.45 and babel-preset-gatsby 0.2.36 provides more typescript errors than before:
if I'm turning esModuleInterop: true - I'm getting issues with importing json files which renders resolveJsonModule: true useless. |
configstore
and module
dependencies
@JustFly1984 what version of TS are you using? This feels peculiar that your local is failing because of some typings within the @types dependencies. |
@blainekasten We are using latest "typescript": "3.8.3", node 13.11.0 our tsconfig.json
how else can I help to solve this issue? I have same kind of import issue with other package - |
@blainekasten still getting same typescript errors in please help |
@blainekasten this problem is still not resolved. You just need to change the value You will write code on a normal TS without compatibility mode (esModuleInterop). And such problems will no longer appear :) The fact is that it is possible to write code without problems with the The main thing is that without the We in our projects set the value of the Here's how to fix import * as Module from "module" import * as Configstore from "configstore" |
@awwit @JustFly1984 I tried reproducing this and couldn't.. Could you share how you are using |
@blainekasten @awwit So hear me out - I dug deep into gatsby code, and it using node v10.x as default. I have successfully fixed issue with @blainekasten Is there a way to remove dependency on Module in |
@blainekasten you are right, the problem is not in the build, it is successful. The problem occurs when we run Our project is configured so that when trying to commit, the code is checked for validity using Now I saw where the problem is: you include |
@blainekasten Please customize only required types in tsconfig.json in each repo which works with typescript. Also you need to update @types/node for gatsby-core-utils and node to 13.3.0 at least, to support Module. |
configstore
and module
dependenciesconfigstore
and module
dependencies, and gatsby-link
@blainekasten Now after attempt to update gatsby to 2.20.10 I got one typescript error more.
|
crosslinking: #22754 |
@blainekasten @awwit I'm currently found the only way to workaround current 3 TS bugs, is add flag this is my set of npm scripts for those who has same issues as me:
without --skipLibCheck there is 3 typescript errors. I'm still afraid that there could be some other serious dependency issue, so we are going to update dependencies manually, instead of merging commits automatically with dependabot. |
Thanks @JustFly1984 .. I'm going to use your |
currently 3 errors has been dissapeared in 2.22.19 version, but one more appeared: node_modules/gatsby/index.d.ts:14:27 - error TS2307: Cannot find module './src/bootstrap/load-plugins/types' or its corresponding type declarations.
14 import { PluginRef } from "./src/bootstrap/load-plugins/types"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.
error Command failed with exit code 1. |
Closing an issue, due to correct fix |
[gatsby-core-utils] update from 1.0.28 to 1.0.30 brings new dependency configstore "^5.0.0", which causes errors in typescript
Describe the issue that you're seeing.
Steps to reproduce
Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue much easier to diagnose (seriously).
How to Make a Minimal Reproduction: https://www.gatsbyjs.org/contributing/how-to-make-a-reproducible-test-case/
Expected result
No errors in typescript
Actual result
Got new TS error
Environment
System:
OS: macOS 10.15.2
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.10.1 - ~/.nvm/versions/node/v13.10.1/bin/node
Yarn: 1.22.1 - /usr/local/bin/yarn
npm: 6.13.7 - ~/.nvm/versions/node/v13.10.1/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 80.0.3987.132
Firefox: 72.0.2
Safari: 13.0.4
npmPackages:
gatsby: 2.19.32 => 2.19.32
gatsby-plugin-manifest: 2.2.44 => 2.2.44
gatsby-plugin-no-sourcemaps: 2.1.2 => 2.1.2
gatsby-plugin-offline: 3.0.37 => 3.0.37
gatsby-plugin-purgecss: 4.0.1 => 4.0.1
gatsby-plugin-react-helmet: 3.1.23 => 3.1.23
gatsby-plugin-robots-txt: 1.5.0 => 1.5.0
gatsby-plugin-root-import: 2.0.5 => 2.0.5
gatsby-plugin-sitemap: 2.2.28 => 2.2.28
gatsby-plugin-typescript: 2.2.2 => 2.2.2
gatsby-plugin-webpack-bundle-analyzer: 1.0.5 => 1.0.5
npmGlobalPackages:
gatsby: 2.19.32
The text was updated successfully, but these errors were encountered: