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

Don't print errors in MDX files #117

Closed
hasparus opened this issue Oct 22, 2020 · 3 comments
Closed

Don't print errors in MDX files #117

hasparus opened this issue Oct 22, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hasparus
Copy link
Contributor

hasparus commented Oct 22, 2020

Howdy 👋

I just encountered this fellow

[typegen] Fail to extract GraphQL documents from /home/hasparus/workspace/homepage/src/pages/music.mdx Provided file type must be one of .js, .jsx, .ts, .tsx, .flow, .flow.js, .flow.jsx, .vue

TypeError: Provided file type must be one of .js, .jsx, .ts, . tsx, .flow, .flow.js, .flow.jsx, .vue

We couldn't use a generated type in .mdx file regardless, so this error seems redundant.

Is there a way to specify file extensions in plugin options, so the error doesn't happen?

@cometkim cometkim added bug Something isn't working enhancement New feature or request labels Oct 22, 2020
@cometkim
Copy link
Owner

cometkim commented Oct 22, 2020

Hmm, I'm confusing. this plugin is notified by Gatsby what files have actually proceeded.

@hasparus Do you have GraphQL document snippets in the mdx file?
Could you share your project config or provide a minimal repro?

@cometkim cometkim added the need to reproduce Reproduciton step is required label Oct 22, 2020
@hasparus
Copy link
Contributor Author

yup, I have a pageQuery in MDX file

some **markdown**

<Component site={page.data.sitePage} />

export const pageQuery = graphql`
  query MusicPageQuery($path: String!) {
    sitePage(path: {eq: $path}) {
      ...TweetDiscussEditLinksDataOnSitePage
    }
  }
`

I'm not sure if my config will be helpful, but I have it public on GitHub right here.
I'm using gatsby-plugin-mdx with an MDX page inside of /pages.

@cometkim cometkim added this to the v3 milestone Oct 27, 2020
@cometkim cometkim self-assigned this Oct 27, 2020
@cometkim cometkim removed need to reproduce Reproduciton step is required enhancement New feature or request labels Jan 4, 2021
@cometkim cometkim mentioned this issue May 10, 2021
Closed
30 tasks
@cometkim
Copy link
Owner

This should be fixed in v3 ([email protected])

cometkim added a commit that referenced this issue Jun 12, 2022
MDX example to validate regression of [#117]

[#117]: #117
cometkim added a commit that referenced this issue Jun 12, 2022
rc.0
- implemente XState based scheduler
- stabilize schema output
- bump GCG
- upgrade yarn to v3
- rewritten core logics
- upgrade eslint to v8
- upgrade plugin's dependencies
- pin graphql version
- rewrite emitSchema service
- rewriten emitPluginDocument service
- rewriten codegen service
- add TS & Flow examples

rc.1
- skip running on cloud build
- fix config validation
- more contexture reporting
- turn `flattenGeneratedTypesIncludeFragments` true
- stabilize documents
- change maybe type to use `null` instead of `undefined`
- update README

rc.2
- add mdx example
- MDX example to validate regression of [#117]
- update dependencies
- added support for `GatsbyImageData` scalar

Resolves #40
Resolves #103
Resolves #104
Resolves #109
Fixes #113
Fixes #117
Fixes #120
Resolves #122
Fixes #124
Resolves #131
Fixes #139, #99
Resolves #146
Fixes #157
Fixes #159
Fixes #160
Fixes #161
Fixes #162
Resolves #168
Resolves #169
Fixes #171

[#117]: #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants