Vue-storefront: Error after updating NVM

Created on 22 Jun 2020  路  5Comments  路  Source: DivanteLtd/vue-storefront

Current behavior


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'?

Expected behavior

Steps to reproduce the issue

Repository

Can you handle fixing this bug by yourself?

  • [ ] YES
  • [ ] NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • [ ] This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • [X] This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • [ ] This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • Browser: All
  • OS: OSX
  • Node: v12.18.0
  • Code Version: latest

Additional information

Normal VSF1 bug

Most helpful comment

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

All 5 comments

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;
Was this page helpful?
0 / 5 - 0 ratings