Open abhishiv opened 3 years ago
+1. I updated from [js] Update graphql-schema-typescript: 1.3.2 → 1.5.2
@abhishiv as a hotfix i just converted file node_modules/.bin/graphql-schema-typescript
from CRLF to LF.
EDIT: Whoops, did not notice that thats a symlink to actual library -> graphql-schema-typescript/lib/cli.js
I installed package and it seems that CRLF issue is present in npm package, but not in current git source (or is it because of git handling this somehow automagically???) :/
find /Users/skaising/.nvm/versions/node/v14.15.4/lib/node_modules/graphql-schema-typescript/lib/cli.js -exec file "{}" ";"
/Users/skaising/.nvm/versions/node/v14.15.4/lib/node_modules/graphql-schema-typescript/lib/cli.js: Node.js script text executable, ASCII text, with CRLF, LF line terminators
and git source:
skaising@Ingus-Skaistkalns ~ % find /Users/skaising/code/graphql-schema-typescript/src/cli.ts -exec file "{}" ";"
/Users/skaising/code/graphql-schema-typescript/src/cli.ts: Node.js script text executable, ASCII text
I'm also experiencing this issue!
Thanks for reporting @IngusSkaistkalns :)
This needs an automated solution
I get this with 1.3.2 and 1.5.2
Invoke it like this in CLI and scripts
: node node_modules/.bin/graphql-schema-typescript
Before:
{
"scripts": {
"gen:schema": "graphql-schema-typescript ...args..."
}
}
After
{
"scripts": {
"gen:schema": "node node_modules/.bin/graphql-schema-typescript ...args..."
}
}
I am also experiencing the same exact issue. Upgraded from 1.3.2 to 1.5.2.
Thank you a lot @tony for the temporary workaround!
I opened a PR to fix line endings on commit by default. That should take care of the first part of this issue. The second one would be taken care of if/when the npm package is updated/rebuilt with correct line endings 🙏
In the meantime, the absolute easiest way to bypass this issue if you run into it, is to run the following command in the project folder where the package was installed (it normalizes the line endings of all the package files recursively):
$ npx crlf --set=LF ./node_modules/graphql-schema-typescript/**/*
Credit goes to this guy, who's blog post I found when troubleshooting the issue 👍
node is installed ofc. Issue with line endings?