question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error TS2307: Cannot find module '@vue/reactivity' or its corresponding type declarations.

See original GitHub issue

Reporting a bug?

When compiling, I am seeing these errors:

Starting compilation in watch mode....yarn/$$virtual/vue-i18n-virtual-8387eb67eb/0/cache/vue-i18n-npm-9.1.6-66ae7003f6-6da7c84c88.zip/node_modules/vue-i18n/dist/vue-i18n.d.ts:3:34 - 
error TS2307: Cannot find module '@vue/reactivity' or its corresponding type declarations.

3 import type { ComputedRef } from '@vue/reactivity';
                                   ~~~~~~~~~~~~~~~~~
.yarn/$$virtual/vue-i18n-virtual-8387eb67eb/0/cache/vue-i18n-npm-9.1.6-66ae7003f6-6da7c84c88.zip/node_modules/vue-i18n/dist/vue-i18n.d.ts:32:42 - 
error TS2307: Cannot find module '@vue/reactivity' or its corresponding type declarations.

32 import type { WritableComputedRef } from '@vue/reactivity';

Module versions (please complete the following information):

  • vue: 3.1.2
  • vue-i18n: 9.1.6 (@next)

Reproduction Link

You can see the minimum changeset required to cause this (it’s basically just installing it)

https://github.com/bbugh/vue-tsx-tailwind-starter/compare/i18n-failure?expand=1

To Reproduce

  1. git clone --depth 1 --branch i18n-failure https://github.com/bbugh/vue-tsx-tailwind-starter
  2. yarn build
  3. Observe the type errors.

Expected behavior

It should compile without an error.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
merceyzcommented, Aug 1, 2021

Yeah, that’s a valid interpretation but it also needs to declare @vue/reactivity

1reaction
merceyzcommented, Jul 11, 2021

That’s an implementation detail and can change so it’s not enough to just peer depend on vue and assume you have access to @vue/reactivity. It’s relying on hoisting to make it available which isn’t guaranteed to be in your favour - https://yarnpkg.com/advanced/rulebook#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies

Read more comments on GitHub >

github_iconTop Results From Across the Web

ts2307: cannot find module '*.vue' or its corresponding type ...
I have got a Vue3 project running through Vite and trying to import my Vue3 component files in my App.vue . But instead...
Read more >
4 - Stack Overflow
typescript - TS2307: Cannot find module './App. vue' or its corresponding type declarations - Stack Overflow. Stack Overflow for Teams – Start collaborating ......
Read more >
TypeScript configuration and TS2307: Cannot find module error
I'm trying to set up a TypeScript project with the vue-class-component decorator support. Everything seems to be fine, the application ...
Read more >
@vue/reactivity - npm
Start using @vue/reactivity in your project by running `npm i ... indicating that this package has built-in type declarations.
Read more >
ts2307 cannot find module / import "fail" in vue files : WEB-37740
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found