Skip to content
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

Typescript types regression starting in version 2.24.81 #27573

Closed
timmywil opened this issue Oct 20, 2020 · 1 comment · Fixed by #27578
Closed

Typescript types regression starting in version 2.24.81 #27573

timmywil opened this issue Oct 20, 2020 · 1 comment · Fixed by #27578
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@timmywil
Copy link

timmywil commented Oct 20, 2020

Description

This issue is a regression in the Typescript types, caused by PR 27381, specifically this commit: 2499676

It pulls the type from the src folder, which is fine in development, but the src folder is not included in the distributed npm package so you just get a file missing error.

Steps to reproduce

Run tsc --noEmit on a project including gatsby from npm.

The workaround for now is to revert gatsby and gatsby-plugin-utils.

Expected result

No type error.

Actual result

node_modules/gatsby/index.d.ts:29:36 - error TS2307: Cannot find module './src/bootstrap/load-plugins/types' or its corresponding type declarations.

29 export { IPluginInfoOptions } from "./src/bootstrap/load-plugins/types"

Environment

System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: 5.0.11 - /usr/local/bin/bash
Binaries:
Node: 12.18.4 - ~/.nvm/versions/node/v12.18.4/bin/node
npm: 6.14.6 - ~/.nvm/versions/node/v12.18.4/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.80
Firefox: 80.0
Safari: 14.0
npmPackages:
gatsby: ^2.24.83 => 2.24.83
gatsby-image: ^2.4.21 => 2.4.21
gatsby-link: ^2.4.16 => 2.4.16
gatsby-plugin-canonical-urls: ^2.3.13 => 2.3.13
gatsby-plugin-create-client-paths: ^2.3.13 => 2.3.13
gatsby-plugin-emotion: ^4.3.14 => 4.3.14
gatsby-plugin-feed: ^2.5.17 => 2.5.17
gatsby-plugin-google-analytics: ^2.3.19 => 2.3.19
gatsby-plugin-manifest: ^2.4.35 => 2.4.35
gatsby-plugin-offline: ^3.2.35 => 3.2.35
gatsby-plugin-optimize-svgs: ^1.0.3 => 1.0.4
gatsby-plugin-react-helmet: ^3.3.14 => 3.3.14
gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
gatsby-plugin-remove-trailing-slashes: ^2.3.13 => 2.3.13
gatsby-plugin-s3: ^0.3.5 => 0.3.5
gatsby-plugin-sharp: ^2.6.43 => 2.6.43
gatsby-plugin-sitemap: ^2.4.17 => 2.4.17
gatsby-plugin-twitter: ^2.3.12 => 2.3.12
gatsby-plugin-typescript: ^2.4.23 => 2.4.23
gatsby-plugin-typography: ^2.5.13 => 2.5.13
gatsby-react-router-scroll: ^3.0.15 => 3.0.15
gatsby-remark-autolink-headers: ^2.3.15 => 2.3.15
gatsby-remark-copy-linked-files: ^2.3.19 => 2.3.19
gatsby-remark-embed-video: ^3.0.10 => 3.0.10
gatsby-remark-embedder: ^3.0.0 => 3.0.0
gatsby-remark-images: ^3.3.37 => 3.3.37
gatsby-remark-prismjs: ^3.5.16 => 3.5.16
gatsby-remark-responsive-iframe: ^2.4.17 => 2.4.17
gatsby-remark-smartypants: ^2.3.13 => 2.3.13
gatsby-source-filesystem: ^2.3.35 => 2.3.35
gatsby-source-graphql: ^2.7.6 => 2.7.6
gatsby-transformer-remark: ^2.8.44 => 2.8.44
gatsby-transformer-sharp: ^2.5.19 => 2.5.19

@timmywil timmywil added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 20, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 20, 2020
@mxstbr
Copy link
Contributor

mxstbr commented Oct 20, 2020

We need to move that type out of gatsby OR duplicate it in gatsby-plugin-utils so we can also remove the circular dependency between gatsby and gatsby-plugin-utils, which breaks publishing sometimes! cc @wardpeet

@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants