I got two error this morning after updating NVM
[tsl] ERROR in /vue-storefront/test/unit/setupTestEnvironment.ts(4,43)
TS2352: Conversion of type 'Global & typeof globalThis' to type 'GlobalWithFetchMock' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property 'fetchMock' is missing in type 'Global & typeof globalThis' but required in type 'GlobalWithFetchMock'.
And this one
[tsl] ERROR in /vue-storefront/src/modules/google-tag-manager/hooks/afterRegistration.ts(13,16)
TS2749: 'VueGtm' refers to a value, but is being used as a type here. Did you mean 'typeof VueGtm'?
Pick one option.
develop branch and create Pull Request 2. Feature / Improvement back to develop.release branch and create Pull Request 3. Stabilisation fix back to release.hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.thanks, this is related with added types in vue-gtm in version 2.2.0. We use 2.0.0 where there aren't any types
If by chance you have ran a yarn upgrade and wish to revert node_modules to earlier versions you need to run yarn cache clean, delete node modules then yarn install again
@Coeur-Digital I'm getting same issue. Did you manage to get this working? We've tried fixing vue-gtm to 2.0.0 (where @gibkigonzo mentioned there are no types) but still getting same errors.
We tried this
yarn add [email protected]
yarn cache clean
yarn install again
and this error went off
/vue-storefront/src/modules/google-tag-manager/hooks/afterRegistration.ts
Thanks for the response @sudarshann . The problem is probably related to changes in the newest version of vue-gtm.
About problem with GlobalWithFetchMock you could inside test/unit/setupTestEnvironment.ts - at first, cast to unknown type:
const customGlobal: GlobalWithFetchMock = (global as unknown) as GlobalWithFetchMock;
Most helpful comment
We tried this
and this error went off
/vue-storefront/src/modules/google-tag-manager/hooks/afterRegistration.ts