Giter Club home page Giter Club logo

typescript-bug's Introduction

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 PM

 error  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<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>>'.
      Object literal may only specify known properties, and 'metaInfo' does not exist in type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>>'.
     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.

typescript-bug's People

Contributors

callumacrae avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.