Navigator is not defined error in nexjs app

Tags: #<Tag:0x00007efc6555d0f8> #<Tag:0x00007efc6555cfb8>
  • using handsontable in nextjs app
  • the table is working and loads the data on first render
  • when I reload the page I get the error:

ReferenceError: navigator is not defined
at setBrowserMeta (file:///Users/…/node_modules/handsontable/helpers/browser.mjs:68:45)
at file:///Users/…/node_modules/handsontable/helpers/browser.mjs:90:1
at ModuleJob.run (node:internal/modules/esm/module_job:193:25) {
page: ‘/auth/business-rules’

I’m not sure what to do here - any help would be greatly appreciated!

Code below:
// a save button outside the table triggers this patch request
const handleSave = async (data:any) => {
try {
const response = await axios.patch(’/api/business-rules’, data);
// then reloads the page to refresh data from db
router.reload()
return response.data;
} catch (error) {
console.error(error);
return error;
}
};

Hi @frank.mcmanus

Thank you for contacting us. To the best of my knowledge, this issue isn’t related to Handsontable itself. I see similar issues reported on Next.js GitHub, maybe that will be also helpful in your case:

1 Like

Thanks so much - I’ll check this out!