vue-scrollto icon indicating copy to clipboard operation
vue-scrollto copied to clipboard

Error during build (Typescript version)

Open smaharj1 opened this issue 5 years ago • 4 comments

When I do npm run serve, I do not see any issues but when I build the application with npm run build, I get the following error:

42:22 Could not find a declaration file for module 'vue-scrollto'. '/Users/project/node_modules/vue-scrollto/vue-scrollto.js' implicitly has an 'any' type.
  Try `npm install @types/vue-scrollto` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-scrollto';`

  > 42 | import ScrollTo from 'vue-scrollto';
       |                      ^
    43 |
    44 | @Component({
    45 |   components: {

 ERROR  Build failed with errors.

smaharj1 avatar Feb 12 '19 05:02 smaharj1

It means you don't have the correct typings.

To fix this, install them like this: npm install --save-dev @types/vue-scrollto

janekkkk avatar Sep 10 '19 09:09 janekkkk

@types/vue-scrollto is a stub package, which claims that vue-scrollto provides type definitions itself.

mwgamble avatar Jul 15 '20 06:07 mwgamble

@types/vue-scrollto is a stub package, which claims that vue-scrollto provides type definitions itself.

https://github.com/rigor789/vue-scrollto/blob/master/vue-scrollto.d.ts

rigor789 avatar Jul 15 '20 10:07 rigor789

I had to add vue-scrollto to the types configuration in my tsconfig.json file for Typescript to pick it up. That isn't normal for a package that provides its own type definitions.

mwgamble avatar Jul 16 '20 02:07 mwgamble