Home > Blockchain >  Cannot use import statement outside a module with @pusher/push-notifications-web nodejs - beams
Cannot use import statement outside a module with @pusher/push-notifications-web nodejs - beams

Time:03-16

I am trying to follow this tutorial using nodejs and express: https://pusher.com/docs/beams/reference/web/#npm-yarn

First I did: npm install @pusher/push-notifications-web before adding the code.

But when I add this code in the index.js file:

import * as PusherPushNotifications from "@pusher/push-notifications-web";

const beamsClient = new PusherPushNotifications.Client({
  instanceId: "<YOUR_INSTANCE_ID_HERE>",
});

beamsClient.start().then(() => {
  // Build something beatiful            
  • Related