You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating apollo to 2.34.0, i get an error on windows when generating typescript code:
Error: Command failed: apollo client:codegen --localSchemaFile=C:\companyname\__generated__\schema.json,C:\companyname\src\clientSchema.graphql --target=typescript --includes=C:\companyname\src\**\*.graphql --globalTypesFile=./__generated__/globalTypes.ts --suppressDeprecationWarning --excludes=C:\companyname\src\clientSchema.graphql
⚠️ It looks like there are 0 files associated with this Apollo Project. This may be because you don't have any files yet, or your includes/excludes fields are configured incorrectly, andd Apollo can't find your files. For help configuring Apollo projects, see this guide: https://go.apollo.dev/t/config
Error: No operations or fragments found to generate code for.
Solution
Change backslashes to forwardslashes.
-npx apollo client:codegen --localSchemaFile=C:/company/__generated__/schema.json,C:/company/src/clientSchema.graphql --target=typescript --includes=C:/company/src/**/*.graphql --globalTypesFile=./__generated__/globalTypes.ts --suppressDeprecationWarning --excludes=C:/company/src/clientSchema.graphql;+npx apollo client:codegen --localSchemaFile=C:\company\__generated__\schema.json,C:\company\src\clientSchema.graphql --target=typescript --includes=C:\company\src\**\*.graphql --globalTypesFile=./__generated__/globalTypes.ts --suppressDeprecationWarning --excludes=C:\company\src\clientSchema.graphql;
Why does this happen?
[email protected] uses [email protected] which upgrades glob from ^7.1.3 to ^8.0.0, which has a breaking change which makes it use backslashes as escape characters instead of path separators on windows.
A fix would be to normalize the paths to unix-style using the normalize-path package before using glob to find files to transform, but because this package is deprecated i just wanted to document a potential fix for this error.
The text was updated successfully, but these errors were encountered:
Problem
After updating
apollo
to 2.34.0, i get an error on windows when generating typescript code:Solution
Change backslashes to forwardslashes.
Why does this happen?
[email protected] uses [email protected] which upgrades glob from ^7.1.3 to ^8.0.0, which has a breaking change which makes it use backslashes as escape characters instead of path separators on windows.
A fix would be to normalize the paths to unix-style using the normalize-path package before using glob to find files to transform, but because this package is deprecated i just wanted to document a potential fix for this error.
The text was updated successfully, but these errors were encountered: