2

facing this issue while integrating node module @pusher/push-notifications-web https://github.com/pusher/push-notifications-web

I am not sure if this is an issue with NextJs or with the node module itself.

Everything works fine when the pages load for the first time, but when by any chance if we refresh the page or redirect the user to a new page. I am getting this error

enter image description here

enter image description here

1

1 Answer 1

0

The issue can be fixed by transpiling @pusher/push-notifications-web module - which is exported as ESM - using next-transpile-modules in Next.js config:

// next.config.js const withTM = require('next-transpile-modules')(['@pusher/push-notifications-web']); module.exports = withTM({/* custom config */}); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.