sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Cannot find module "@ms/sp-telemetry" on SPFx unittest

Open veeramanx opened this issue 8 years ago • 7 comments

I am writing unit test for SPFx web part. when i run gulp test command i am getting the following error Cannot find module "@ms/sp-telemetry". i am using '@microsoft/sp-http' in the react component.

I have the following versions

 "dependencies": {
 "@microsoft/decorators": "^1.5.0",
    "@microsoft/sp-application-base": "^1.5.0",
    "@microsoft/sp-client-preview": "^1.5.0",
    "@microsoft/sp-core-library": "^1.5.0",
    "@microsoft/sp-http": "^1.5.0",
    "@microsoft/sp-lodash-subset": "^1.5.0",
    "@microsoft/sp-office-ui-fabric-core": "~1.4.1",
    "@microsoft/sp-webpart-base": "^1.5.0",

"devDependencies": {
    "@microsoft/sp-build-web": "^1.5.0",
    "@microsoft/sp-module-interfaces": "^1.5.0",
    "@microsoft/sp-webpart-workbench": "^1.5.0",
    "@types/chai": ">=3.4.34 <3.6.0",
    "@types/enzyme": "^2.8.12",
    "@types/mocha": ">=2.2.33 <2.6.0",
    "@types/sinon": "^1.16.36",

Please do let me know if any additional information required. Thanks,

veeramanx avatar Jun 12 '18 13:06 veeramanx

Which node.js version you are using? Can you try with 8.11.2?

muradaliyev avatar Jun 12 '18 15:06 muradaliyev

Hi, I am using Node version:v8.9.4 . let me try with 8.11.2 and keep you updated.

veeramanx avatar Jun 12 '18 15:06 veeramanx

@muradaliyev that didn't help.

veeramanx avatar Jun 13 '18 11:06 veeramanx

Sorry, have nothing to add. It's now tagged as bug by Vesa

muradaliyev avatar Jun 13 '18 16:06 muradaliyev

similar issues about this in the issues list for a while now. https://github.com/SharePoint/sp-dev-docs/issues/526 is one

devinprejean avatar Jul 06 '18 15:07 devinprejean

I had the same issue but i found a fix! Seems I was referencing imports from the same folder, however one group was listed in my index, the other was referenced all the way. For example:

import { ModuleName } From "./provider/module import { SecondModule } from "./provider" once i changed the second module to reference all the way instead of using the index.ts file inside the folder my issue went away. Hope this helps someone.

devinprejean avatar Jul 06 '18 19:07 devinprejean

This issue is being closed as part of an issue list cleanup project. Issues with no activity in the past 6 months that aren't tracked by engineering as bugs were closed as part of this inititive. If this is still an issue, please follow the steps outlined to re-open the issue.

msft-github-bot avatar Jan 22 '20 21:01 msft-github-bot