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

V4 broken for TS nodenext users #6730

Closed
trevor-scheer opened this issue Jul 25, 2022 · 2 comments
Closed

V4 broken for TS nodenext users #6730

trevor-scheer opened this issue Jul 25, 2022 · 2 comments
Assignees
Milestone

Comments

@trevor-scheer
Copy link
Member

Lots of errors like this:

node_modules/@apollo/server/dist/esm/externalTypes/plugins.d.ts:6:344 - error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './requestPipeline.js'?

Repro: https://codesandbox.io/s/musing-albattani-s8v12i

Looks like we just need extensions everywhere, not just runtime imports.

@trevor-scheer trevor-scheer self-assigned this Jul 25, 2022
@trevor-scheer trevor-scheer added this to the Release 4.0 milestone Jul 25, 2022
trevor-scheer added a commit that referenced this issue Aug 24, 2022
When installing @apollo/server v4 in a TS project using "moduleResolution": "nodenext",
TS would throw errors about how Apollo Server's imports need to use extensions. 

Specifically, we omitted extensions from all type-only imports since they didn't seem to
be needed, but it's not hurting anything to add them and some use cases require it.

Add a new smoke test for this use case which will ensure extensions are used in all
source code files, even for type-only imports.

Fixes #6730
@trevor-scheer
Copy link
Member Author

Closed via #6731

@jaydenseric
Copy link

The same issue desperately needs to be fixed in @apollo/client: apollographql/apollo-client#9890 .

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants