I have the most recent version of Visual Studio Code installed. Visual Studio Code is currently utilizing TypeScript v3.3.3. I've successfully installed the following packages via npm, both locally (save-dev) and globally:
- TestCafe v1.1.0
- Core-JS v3.0.
- TypeScript v3.4.1
In addition to this, I've set up a tsconfig.json file with the property - "resolveJsonModule: true"
A config.json file has been created as well, which gets picked up correctly in my .ts file after adding the resolveJsonModule property above -
Import config from './config.json';
However, every time I run my script, I encounter the following error message:
Error: TypeScript compilation failed.
/Users/test/Documents/Dev_Node/TestCafe/UK/homepage-fixture.ts (2, 20):
Cannot find module './config.json'. Consider using '--resolveJsonModule'
to import module with '.json' extension at Function._reportErrors (/Users/test/Documents/Dev_Node/TestCafe/node_modules/testcafe/src/compiler/te st-file/formats/typescript/compiler.js:45:15) at TypeScriptTestFileCompiler._reportErrors [as _precompileCode (/Users/test/Documents/Dev_Node/TestCafe/node_modules/testcafe/src/compiler/test-file/formats/typescript/compiler.js ...
I have already attempted the solutions suggested here: Typescript compiler error when importing json file
Unfortunately, none of those solutions seem to work for me.