slappey icon indicating copy to clipboard operation
slappey copied to clipboard

cannot find module '../slappey.json'.

Open melosh101 opened this issue 5 years ago • 5 comments

version: 3.0.0 lang: typescript manager: yarn os: windows 10 reproducing the error: when i run npm run dev i get the error:

src/index.ts:3:20 - error TS2732: Cannot find module '../slappey.json'. Consider using '--resolveJsonModule' to import module with'.json' extension.

hope the error can be resolved in the near future

melosh101 avatar Dec 27 '20 00:12 melosh101

If your manager is yarn, shouldn't you be using yarn dev to run it?

ghost avatar Dec 27 '20 02:12 ghost

@milaskiller u must have a tsconfig.json file, and on that file you must have a compiler options object that have the value resolveJsonModule to true, this is the way i know to fix this error, your tsconfig.json must be something like this: { "compilerOptions": { "target": "es6", "module": "commonjs", "moduleResolution": "node", "noImplicitAny": false, "removeComments": true, "preserveConstEnums": true, "sourceMap": true, "forceConsistentCasingInFileNames": true, "outDir": "dist", "declaration": true, "esModuleInterop": true, "resolveJsonModule": true }, "include": ["src/**/*.ts"], "exclude": ["src/**/*.spec.ts", "node_modules"] }

xXRadPlayzXx avatar Dec 27 '20 10:12 xXRadPlayzXx

Slappey should automatically generate a tsconfig.json file. With the correct settings in my opinion.

daanbreur avatar Jan 30 '21 18:01 daanbreur

make sure that the slappey.json file is in the same directory as the file you use to run the bot

GVELLS avatar Jan 31 '21 00:01 GVELLS

Worked for me - slappey forgot to generate me a tsconfig file

PiggyPlex avatar Jun 05 '21 18:06 PiggyPlex