jitsu icon indicating copy to clipboard operation
jitsu copied to clipboard

Cannot use Jitsu in a NextJs MIddleware

Open thibaultleouay opened this issue 3 months ago • 1 comments

We are using Jitsu to track analytics

But because of this it cannot be used in middleware

Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime 
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation

The error was caused by importing '@jitsu/js/dist/jitsu.es.js' in   in '../../packages/analytics/src/index.ts' 

https://github.com/jitsucom/jitsu/blob/70fdf6a5000640ba46732331f65bea46e165e153/libs/jitsu-js/src/destination-plugins/tag.ts#L59C1-L73C14

thibaultleouay avatar May 06 '24 11:05 thibaultleouay