Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Companion: Cannot find module 'messaging'.?

ANSWERED

I am losing it trying to add a companion to my first watch face. I've added an index.ts file to /companion/ but for some reason I cannot seem to import modules at build. What am I doing wrong?

 

Screen Shot 2019-01-20 at 9.45.37 PM.png

Screen Shot 2019-01-20 at 9.50.02 PM.png

companion/index.ts

import * as messaging from "messaging";
import { geolocation } from "geolocation";

app/index.js

import document from "document";
import * as messaging from "messaging";
import { geolocation } from "geolocation";
import { HeartRateSensor } from "heart-rate";
import { BodyPresenceSensor } from "body-presence";
import { today } from "user-activity";
import { battery } from "power";
import { preferences } from "user-settings";
import clock from "clock";
import * as util from "../common/utils";

Been battling this for a few hours and no searches show anyone previously having this issue. Any ideas?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Welp. Always seems like typing out my issue somewhere helps unlock new things to check.

 

I realized that I was mixing javascript and typescript between the app and companion. Once I changed the companion index.ts to index.js the project built just fine. 

 

Going to leave this as a solution since it could help others.

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

Welp. Always seems like typing out my issue somewhere helps unlock new things to check.

 

I realized that I was mixing javascript and typescript between the app and companion. Once I changed the companion index.ts to index.js the project built just fine. 

 

Going to leave this as a solution since it could help others.

Best Answer
0 Votes