Closed TokugawaTakeshi closed 5 years ago
@DanielRosenwasser heard you like customer development
@TokugawaTakesi did the answer in the Stack Overflow post address this? It sounds like it's a ts-loader issue
@RyanCavanaugh, well, I suppose there's no point to keep this issue opened. There are some riddles left, but it could not be directly related with TypeScript, as you said. I did not tried yet, but maybe Lerna using allows to avoid the errors like that was considered in this issue. Thank you for the bounty in Stack Overflow and TypeScript development!
Thanks for the follow-up! Happy to be of some assistance.
This issue is about TypeScript bug, or the feature that was not documented.
Before open this issue, I asked about this problem in Stack Overflow on three languages, spent three Stack Overflow bounties and also also opened issue in vue-property-decorator repository (I will append links). Nobody could make some explanation about this error (for the moment when I wrote this issue).
I got below TypeScript error when tried to use side Vue component implemented in TypeScript (outside of project directory):
My WebStorm IDE did not detect this error; in was outputted in console when I ran Webpack (TypeScript loader is ts-loader).
The error occurs in:
As follows from
ui-kit-libary-in-development
name, it is not npm-dependency yet, so it is not insidenode_modules
for now.It was exclusively TypeScript error; although
ts-loader
casts this error, Webpack builds my project and compiled JavaScript works correctly. This error will disappear if to do one of below actions:SimpleCheckbox.vue
to same directory asSkipProjectInitializationStepPanel.ts
and import it asimport SimpleCheckbox from './SimpleCheckbox.vue';
SimpleCheckbox
from@Component({ template, components: { SimpleCheckbox } })
and leave only@Component({ template, components: {} })
(off course,SimpleCheckbox
will no be rendered in this case, but I had to do this experiment).ui-kit-libary-in-development
tonode_modules
of main project and removenode_modules
fromui-kit-libary-in-development
(if don't remove, nothing will change).Unfortunately, I could not reproduce this problem. For some reason below try of reproduction works without errors:
MainProject/src/Application.vue
MainProject/src/PageComponents/PageOne.ts
MainProject/src/PageComponents/PageOne.pug
ui-kit-libary-in-development/UiComponents/Buttons/Button.vue
All clues what I found is this comment in issue Setting components in Component decorator causes Typescript 2.4 error:
From this clue, the following question arising:
.d.ts
- in my main project or dependency? Most likely in main project, but if it so, why I can import side components in third-party libraries likevuetify
? Because there is.d.ts
there!.d.ts
? Some tutorial or example?Because I could not reproduce this problem and my project still is raw (has not got commercial value yet), I can share it by Google Drive (link for downloading zip archive). All
node_modules
are included, just runnpm run developmentBuild
inmain-project
directory.If you are worry about viruses, you can also get source files in this repository, but because it is does not include node_modules, for reproducing it's required to execute
npm install
in bothmain-project
anddependency
directories.Links:
TypeScript Version: ^3.7.0-dev.20190906
Error occurred, but error code has been changed:
Search Terms:
TS2345:
, "vue-property-decorator Argument of type is not assignable to parameter of type 'VueClass