We're using statsig in next.js middleware to initialize & close statsig sessions & check some feature gates, but we're unable to update statsig-node to release 5.7.1 due to nextjs build errors.
build: Failed to compile.
build:
build: ../node_modules/js-sha256/src/sha256.js
build: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
build: Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation
build:
build: Import trace for requested module:
build: ../node_modules/js-sha256/src/sha256.js
build: ../node_modules/statsig-node/dist/Evaluator.js
build: ../node_modules/statsig-node/dist/StatsigServer.js
build: ../node_modules/statsig-node/dist/index.js
build: ./src/utils/statsigUtils.ts
Seems like the new dependency js-sha256 that was added in #30 uses eval .
We're using statsig in next.js middleware to initialize & close statsig sessions & check some feature gates, but we're unable to update statsig-node to release 5.7.1 due to nextjs build errors.
Seems like the new dependency
js-sha256
that was added in #30 useseval
.Please LMK if you want a reproducible example!
Reference