Typescript error "TS2307: Cannot find module '../aurelia.json'" within build tasks
See original GitHub issueI’m submitting a bug report (i guess)
- Library Version: 1.0.8
Please tell us about your environment:
-
Operating System: Windows 10
-
Node Version: 6.9.4
-
NPM Version: 4.1.1
-
Browser: Not Browser related
-
Language: TypeScript 2.1.5
-
Current behavior: The line
import * as project from '../aurelia.json';
inside the build tasks (aurelia_project\tasks\build.ts
,aurelia_project\tasks\process-css.ts
etc.) reports the TypeScript errorTS2307: Cannot find module '../aurelia.json'
even though the fileaurelia.json
exists in the folderaurelia_project
. -
What is the expected behavior? Whilst building etc. is actually working as expected, I find it annoying & misleading to see TypeScript errors in my IDE (files & folders are marked red, the TypeScript panel shows those erros etc.) and I guess it will bite me when starting create a deploy process.
This can be reproduced by creating a new project using au new
with the following options (CLI version ``):
- 3 Custom
- 2 TypeScript
- 3 Max minification
- 3 Sass
- 1 Yes (Unit Testing)
- 4 WebStorm
- 1 Yes (Create Project)
- 1 Yes (Install Dependencies)
The errors are reported within PhpStorm 2016.3.2
as well as VSCode 1.8.1 & 1.9.1
Ps.: I’m not sure if this is related to https://github.com/aurelia/cli/issues/300 even though the title suggests otherwise since I believe that the issue there is about including JSON files within the source code, not within the build…
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (8 by maintainers)
Following https://github.com/aurelia/cli/issues/300#issuecomment-251072000, can you try adding a file “
json-loader.d.ts
” incustom_typings/
with the contents:~Can you please try changing the import statement to:~