greeny / SatisfactoryTools

Satisfactory Tools for planning and building the perfect base.
https://www.satisfactorytools.com/
MIT License
268 stars 57 forks source link

error when trying to update data.json with yarn parseDocs #67

Closed jj314 closed 1 year ago

jj314 commented 3 years ago
$ yarn parseDocs
yarn run v1.22.5
$ ts-node -r tsconfig-paths/register bin/parseDocs.ts

C:\Users\X\Desktop\SatisfactoryTools\bin\parseDocs.ts:41
                case 'Class\'/Script/FactoryGame.FGConsumableDescriptor\'':
                ^
SyntaxError: Unexpected token � in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (C:\Users\X\Desktop\SatisfactoryTools\bin\parseDocs.ts:41:17)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Module.m._compile (C:\Users\X\Desktop\SatisfactoryTools\node_modules\ts-node\src\index.ts:858:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\X\Desktop\SatisfactoryTools\node_modules\ts-node\src\index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at main (C:\Users\X\Desktop\SatisfactoryTools\node_modules\ts-node\src\bin.ts:227:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
greeny commented 3 years ago

you need to convert it from UTF16-LE to UTF-8 first, sorry, that step is missing from readme for some reason

jj314 commented 3 years ago

What file do you mean, parseDocs.ts or Docs.json? Converting Docs.json doesn't help and parseDocs.ts doesn't seem to be encoded in UTF16-LE.

greeny commented 3 years ago

I mean Docs.json. It should work if you convert it correctly. Ping me on Discord (greeny#4945) if you want more help with this.

greeny commented 1 year ago

Closing as it has been answered.