Implement pusher for real-time web notifications in nextjs

738 Views Asked by At

I am getting the below error after initializing pusher on nextjs application:

export { Client, RegistrationState, TokenProvider };
^^^^^^
SyntaxError: Unexpected token 'export'

I have also tried modifying the next.config.js file to the following:

const withTM = require("next-transpile-modules")(["@pusher/push-notifications-web"])
module.exports = withTM({
  env: {
    apiBaseUrl: "",
    apiBaseUrlChat: ""
  },
});

When I am trying to execute npm run dev, it is giving me the following error:

TypeError: modules.map is not a function
0

There are 0 best solutions below