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

Unable to generate tranformer schema when the package is npm link 'ed #1655

Open
N0K0 opened this issue Oct 8, 2022 · 0 comments
Open

Unable to generate tranformer schema when the package is npm link 'ed #1655

N0K0 opened this issue Oct 8, 2022 · 0 comments

Comments

@N0K0
Copy link

N0K0 commented Oct 8, 2022

Description

So this is a facinating problem.
I've forked transformer-remark here: https://github.com/N0K0/gridsome-transformer-obsidian
(Note what i've written in the readme if this is a giant XY problem too! )

Blog i'm testing on here: https://github.com/N0K0/my-gridsome-blog

When i'm pulling my test package from npm here: https://www.npmjs.com/package/gridsome-transformer-obsidian
And build everything works, but when i do npm link ../gridsome-transformer-obsidian i get an error.

Steps to reproduce

  1. git clone https://github.com/N0K0/gridsome-transformer-obsidian
  2. Temp bump to version 0.0.9 locally (to verify npm link)
  3. git clone https://github.com/N0K0/my-gridsome-blog
  4. cd my-gridsome-blog
  5. gridsome build
  6. Everything works
  7. npm link ../gridsome-transformer-obsidian
  8. gridsome build
  9. Fails

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).

Expected result

A smooth build and a shiny blog

Actual result

Error: TypeError[Post.content]: Cannot convert to InputType the following value: Object({ type: String, resolve: [function resolve] })
    at TypeMapper.convertOutputFieldConfig (/home/n/git/gridsome-markdown-example-main/node_modules/graphql-compose/lib/TypeMapper.js:320:13)
    at ObjectTypeComposer.setField (/home/n/git/gridsome-markdown-example-main/node_modules/graphql-compose/lib/ObjectTypeComposer.js:210:114)
    at createThirdPartyFields (/home/n/git/gridsome-markdown-example-main/node_modules/gridsome/lib/graphql/nodes/index.js:195:18)
    at createNodesSchema (/home/n/git/gridsome-markdown-example-main/node_modules/gridsome/lib/graphql/nodes/index.js:39:5)
    at createSchema (/home/n/git/gridsome-markdown-example-main/node_modules/gridsome/lib/graphql/createSchema.js:59:3)
    at Schema.buildSchema (/home/n/git/gridsome-markdown-example-main/node_modules/gridsome/lib/app/Schema.js:28:28)
    at Plugins.createSchema (/home/n/git/gridsome-markdown-example-main/node_modules/gridsome/lib/app/Plugins.js:94:22)

Environment

Before link:

  System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
  Binaries:
    Node: 16.17.1 - /usr/bin/node
    npm: 8.15.0 - /usr/bin/npm
  npmPackages:
    @gridsome/source-filesystem: ^0.6.2 => 0.6.2 
    gridsome: ^0.7.23 => 0.7.23 
    gridsome-transformer-obsidian: ^0.0.8 => 0.0.8 

After link:

  System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
  Binaries:
    Node: 16.17.1 - /usr/bin/node
    npm: 8.15.0 - /usr/bin/npm
  npmPackages:
    @gridsome/source-filesystem: ^0.6.2 => 0.6.2 
    gridsome: ^0.7.23 => 0.7.23 
    gridsome-transformer-obsidian: ^0.0.8 => 0.0.9 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant