cannot find module '../slappey.json'.
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
If your manager is yarn, shouldn't you be using yarn dev to run it?
@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"] }
Slappey should automatically generate a tsconfig.json file. With the correct settings in my opinion.
make sure that the slappey.json file is in the same directory as the file you use to run the bot
Worked for me - slappey forgot to generate me a tsconfig file