Closed brendanmc6 closed 5 years ago
Hmm, it seems this really is uncharted territory. (The gatsby issue is https://github.com/gatsbyjs/gatsby/issues/9056 for reference.)
We are using createRemoteFileNode
from the gatsby-source-filesystem
package directly. It looks like the file type is correctly set as gatsby-transformer-remark
is picking it up. So I would surmise the transformer-remark
is getting some value that isn't expected. That might get us somewhere in debugging, but I don't have time at the moment to dig deeper.
It seems like the easiest thing to do in the short term is to use onCreateNode to take the markdown fields and create new nodes that are linked to the original airtable node and set the mediaType of the new node to text/markdown so it gets processed correctly.
Another solution is for source-airtable to support mapping fields to media types similar to source-mongodb https://www.gatsbyjs.org/packages/gatsby-source-mongodb/?=mongo#mapping-mediatype-feature
@KyleAMathews perhaps there is some confusion. We do have the ability to map media types already. The issue appears to be with nodes created from createRemoteFileNode
. In this case, they "attached" markdown files and it appears the type is correctly set as remark does pick it up. Perhaps that isn't a popular use case, but moreso #18 might be a more popular / useful use case.
Oh ok, sorry for the confusion. This could just be a bug then in source-airtable then (or gatsby).
It's odd that this and #18 are happening.
No worries.
Could this be an issue with setFieldsOnGraphQLNodeType
when triggered through the createRemoteFileNode
. I was reading code while putting the kiddo to bed, and it seems like both errors (#15 and #18) originate from there. I won't have a chance to try any code for at least a few weeks though so feel free if anyone else has a chance to investigate.
@brendanmc6 were you using any remark plugins? gatsby-remark-images
perhaps?
@jbolda I will have to set up a test and try again-- might be a few days until I can get around to it.
This issue has been automatically marked as stale because it has not had any recent activity for 30 days. It will be closed if no further activity occurs within 7 days. Remove stale label, comment, and/or apply "ongoing issue" label to prevent this from being closed. Thank you for your contributions.
I am trying to attach .md files and bring them in using the "fileNode" mapping as stated in your docs.
I can attach, bring in, and locate .txt files without error, but then gatsby-transformer-remark does not recognize these as markdown. So then when I attach .md files instead, it causes the following typeError:
Is this something to do with the way gatsby-source-airtable is bringing in attachments mapped as fileNode? Because obviously gatsby-transformer-remark should have no problem with .md files.