Giter Club home page Giter Club logo

Comments (6)

johntran avatar johntran commented on July 24, 2024 1

Bam! That suggestion worked well.

The only thing is that the extensions property has to be passed in as many times as you have extensions

relay-compiler --src ./client --schema server/graphql/schema.graphql --extensions=js --extensions=tsx --language typescript --persist

Closing issue now. Thanks!

from relay-compiler-language-typescript.

johntran avatar johntran commented on July 24, 2024

It is worth noting that every single file emitted in the language plugin command is a .tsx or .tsx file, and the file that it is erroring out on is a .js file. Maybe there are complications when trying to parse .js files?

from relay-compiler-language-typescript.

johntran avatar johntran commented on July 24, 2024

Actually, that was the error.

https://github.com/johntran/relay-compiler-language-typescript/tree/jt-foundRelay-mar30-2

Reproduction can be seen here.

Pull repo
cd example
yarn
yarn update-schema
yarn build

You will get

ERROR:
GraphQLCompilerContext: Unknown document `BlogHeader_blogPost`.

Let me know if you need anything else!

from relay-compiler-language-typescript.

johntran avatar johntran commented on July 24, 2024

By adding js to the inputExtensions property of the PluginInterface, I was able to get the compiler to work:
johntran@08faa29

What would be the best way to fix this issue? The quick fix could be to add .js and .jsx into the inputExtensions property.

from relay-compiler-language-typescript.

alloy avatar alloy commented on July 24, 2024

@johntran Sorry for the delay, I was out on holiday. You should still be able to specify the --extensions CLI option to the relay-compiler command, the plugin only changes the default. As long as you configure tsc to allowJS it should probably work.

from relay-compiler-language-typescript.

alloy avatar alloy commented on July 24, 2024

Ace!

I think you can do a comma-separated list --extensions tsx,js btw

from relay-compiler-language-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.