Closed fen89 closed 5 years ago
It was a mistake by myself: I already thought that this has something to do with the typescript compiler itself, but I didn't check completely.
Solution was just to exclude the files
- directory inside the root tsconfig.json
:
...
"exclude": [
"node_modules",
"tmp",
"**/files/**"
]
...
Then everything is working as expected.
Thanks! This was helpful
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Expected Behavior
Please describe the behavior you are expecting
Custom Schematics should be able to generate template files.
Current Behavior
What is the current behavior?
While using template files with schematic functions like classify, dasherize, etc. in custom schematics I am getting typescript errors, e.g:
TS1128: Declaration or statement expected.
TS1109: Expression expected.
If I am just using static files the custom schematics do work.
Steps to Reproduce
I am having the same problem like #728 generating a custom schematic. I tested it with a clean nx project, getting the same error.
Steps to reproduce:
ng generate @nrwl/schematics:workspace-schematic akita-store
Context
package.json
Added a new schematic via
ng generate @nrwl/schematics:workspace-schematic akita-store
Updated the
index.ts
file:My folder structure:
With the following context inside
__name@dasherize__.model.ts
:Using the following command to generate that workspace:
npm run workspace-schematic -- akita-store store-test
resulting in the following error:If I change the content of the
__name@dasherize__.model.ts
to be static, e.g:I am getting the following error:
error TS2688: Cannot find type definition file for 'jasmine'.
After installing
@types/jasmine
the commandnpm run workspace-schematic -- akita-store store-test
runs through:Please let me know if you need any additional information!