Axios error on bump novu to 0.13.0
Hi, im trying to update @Novu/node to 0.13.0 but i get axios error
Generic type 'AxiosResponse<T>' requires between 0 and 1 type arguments
when running the project and jest SyntaxError: Cannot use import statement outside a module
when running jest.
Im using pnpm to manage dependencies in a monorepo application.6 Replies
Hi @andreluizsgf are you running novu in local?
oh sorry, the problem is with the package @Novu/node.
Hi @andreluizsgf
Sorry I missed this post
are you still facing this issue?
hi @Pawan Jain . yes im still on this issue.
sharing the logs on jest run:
when trying to run the application
hi @Pawan Jain did you have time to see this issue? 😄
hi @andreluizsgf!
you probably have to set this option in the TS config of your project:
@andreluizsgf some versions of Jest and Axios are not engaging properly because of the module version that Jest tries to run when using Axios inside a Jest test. We have been flagging that in our code and to the different contributors adding a new provider.
https://github.com/novuhq/novu/pull/3218
Another solution is to add this config in the Jest config:
This will help Jest to run the Axios CJS version and not throw that error anymore.
GitHub
fix(app-generic): allow jest to use axios using cjs by p-fernandez ...
What change does this PR introduce?
Instructs Jest to use Axios CJS module.
Why was this change needed?
Allows the Application Generic package tests to be run in the local environment. Some of th...