N
Novu2mo ago
iStun4Fun

Novu @ Next 13.4.8

Hey! Its possible to run a dev instance in the same instance that our project is? we are working on a Next 13.4.8 project and found that we need to create a totally different app to run in dev to work. I can create an endpoint tunnel for the bridging endpoint but.. couldnt we use the workflows and serve on the same app instead of creating a third app in the dev server? Maybe is how we have config the nextJs? we are receiving this bug in a pages/api setup when going to /api/novu:
Server Error
SyntaxError: Named export 'checkIsResponseError' not found. The requested module '@novu/shared' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@novu/shared';
...
Server Error
SyntaxError: Named export 'checkIsResponseError' not found. The requested module '@novu/shared' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@novu/shared';
...
Here is the endpoint content and created it in the way that documentation told us:
// pages/api/novu.ts
import { serve } from '@novu/framework/next';
import { contractsUpdate, progressUpdate } from '@/novu/workflows';

export default serve({ workflows: [contractsUpdate, progressUpdate] });
// pages/api/novu.ts
import { serve } from '@novu/framework/next';
import { contractsUpdate, progressUpdate } from '@/novu/workflows';

export default serve({ workflows: [contractsUpdate, progressUpdate] });
4 Replies
Pawan Jain
Pawan Jain2mo ago
@iStun4Fun
we need to create a totally different app to run in dev to work
We support adding @novu/framework in existing applications.
iStun4Fun
iStun4FunOP2mo ago
I know but its working at next 13.4.8 with pages router? because we get this error
Server Error
SyntaxError: Named export 'checkIsResponseError' not found. The requested module '@novu/shared' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@novu/shared';
...
Server Error
SyntaxError: Named export 'checkIsResponseError' not found. The requested module '@novu/shared' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@novu/shared';
...
Pawan Jain
Pawan Jain2mo ago
@iStun4Fun I am able to reproduce the issue. Sharing it with team https://github.com/jainpawan21/nextjs-version-13.4.8-novu-framework
iStun4Fun
iStun4FunOP2mo ago
awesomely great, thanks any clues on this @Pawan Jain ? maybe we can hack it up to fix it in our end if any clues arised Solved it migrating to Next 14 or 15

Did you find this page helpful?