Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/callumacrae/typescript-bug
https://github.com/callumacrae/typescript-bug
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/callumacrae/typescript-bug
- Owner: callumacrae
- Created: 2019-09-17T12:22:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T10:36:50.000Z (about 2 years ago)
- Last Synced: 2024-12-17T05:29:31.271Z (23 days ago)
- Language: JavaScript
- Homepage:
- Size: 1.78 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Steps to replicate
To install, run
```
npm install
```This will have installed the `generic-minimal` module as an actual module inside of node_modules.
To run the build, run:
```
npm run build
```This should work (this time).
To break, replace the generic-minimal module with a symlinked version, as if you were using npm link:
```
# Replace generic-minimal with symlinked version
cd generic-minimal
npm install
cd ..
rm -rf node_modules/generic-minimal
ln -s "$(pwd)/generic-minimal" node_modules/generic-minimal# Symlink vue back out again so that both refer to the same version of vue
ln -s "$(pwd)/node_modules/vue" node_modules/generic-minimal/node_modules/vue
```Now, when you run the build, you see the following error:
```
ERROR Failed to compile with 1 errors 1:18:22 PMerror in /Users/callumacrae/Sites/samknows/generic-microsite/src/App.vue
ERROR in /Users/callumacrae/Sites/samknows/generic-microsite/src/App.vue
10:3 No overload matches this call.
The last overload gave the following error.
Argument of type '{ metaInfo: { title: string; }; }' is not assignable to parameter of type 'ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record>'.
Object literal may only specify known properties, and 'metaInfo' does not exist in type 'ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record>'.
8 | import Vue from 'vue';
9 | export default Vue.extend({
> 10 | metaInfo: {
| ^
11 | title: 'WTF'
12 | }
13 | });ERROR Build failed with errors.
```This happens with npm link and wherever the directories are relative to each other.
The only difference is that the module is symlinked instead of actually there. For some reason, that means that typescript isn't including the types from the modules being used from node_modules, such as `vue-meta`. This has also happened with other modules such as `vue-i18next` and `vuex`.