Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description Removes `Statsig.shutdown()` from middleware. Calling Statsig.shutdown leads to a race condition when multiple requests happen to the same middleware: - Request A calls `await Statsig.initialize()` - Request B calls `await Statsig.initialize()` - Request A calls `Statsig.shutdown()` destroying the singleton - Request B tries to use Statsig but the singleton is no longer initialized This leads to the following error being thrown ``` Error: Call and wait for initialize() to finish first. at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/Errors.js:22:27) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/StatsigServer.js:532:27) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/StatsigServer.js:523:30) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/StatsigServer.js:463:22) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/StatsigServer.js:224:70) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/ErrorBoundary.js:27:25) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/StatsigServer.js:224:35) at (node_modules/.pnpm/statsig-node@5.9.3/node_modules/statsig-node/dist/index.js:160:37) at (middleware.ts:33:27) at (node_modules/.pnpm/next@13.4.20-canary.30_react-dom@18.2.0+react@18.2.0/node_modules/next/dist/esm/server/web/adapter.js:150:19) ```
- Loading branch information
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-api-routes-json-response – ./edge-api-routes/json-response
edge-api-routes-json-response.vercel.app
edge-api-routes-json-response-git-main.vercel.sh
edge-api-routes-json-response.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-api-routes-query-parameters – ./edge-api-routes/query-parameters
edge-api-routes-query-parameters.vercel.app
edge-api-routes-query-parameters.vercel.sh
edge-api-routes-query-parameters-git-main.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-api-routes-hello-world – ./edge-api-routes/hello-world
edge-api-route.vercel.app
edge-api-routes-hello-world-git-main.vercel.sh
edge-api-routes-hello-world.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-api-routes-cache-control – ./edge-api-routes/cache-control
edge-api-routes-cache-control.vercel.app
edge-api-routes-cache-control-git-main.vercel.sh
edge-api-routes-cache-control.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
redirect-with-fallback – ./app-directory/redirect-with-fallback
redirect-with-fallback.vercel.app
redirect-with-fallback-git-main-vercel-solutions-vtest314.vercel.app
redirect-with-fallback-vercel-solutions-vtest314.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-functions-authed-proxy – ./edge-api-routes/authed-proxy
authed-proxy.vercel.app
edge-functions-authed-proxy.vercel.sh
edge-functions-authed-proxy-git-main.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
postgres-starter – ./storage/postgres-starter
postgres-starter.vercel.app
postgres-starter-vercel-labs.vercel.app
postgres-starter-git-main-vercel-labs.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-testing – ./solutions/testing/apps/main-site
solutions-testing-vercel-solutions-vtest314.vercel.app
solutions-testing-git-main-vercel-solutions-vtest314.vercel.app
solutions-testing.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
wasm-rust-hello-world – ./edge-api-routes/wasm-rust-hello-world
wasm-rust-hello-world.vercel.app
wasm-rust-hello-world-git-main-vercel-solutions-vtest314.vercel.app
wasm-rust-hello-world-vercel-solutions-vtest314.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
examples – ./storage/postgres-starter
examples-bice.vercel.app
examples-git-main-vercel-labs.vercel.app
examples-vercel-labs.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
wasm-rust-xor – ./edge-api-routes/wasm-rust-xor
wasm-rust-xor.vercel.app
wasm-rust-xor-vercel-solutions-vtest314.vercel.app
wasm-rust-xor-git-main-vercel-solutions-vtest314.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kv-redis-starter – ./storage/kv-redis-starter
kv-redis-starter.vercel.app
kv-starter.vercel.app
nextjs-kv-starter.vercel.app
kv-redis-starter-git-main-vercel-labs.vercel.app
kv-redis-starter-vercel-labs.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
blob-starter – ./storage/blob-starter
blob-starter.vercel.app
blob-starter-vercel-labs.vercel.app
blob-starter-git-main-vercel-labs.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-flask – ./python/nextjs-flask
next-flask-vercel-labs.vercel.app
next-flask-git-main-vercel-labs.vercel.app
nextjs-python.vercel.app
nextjs-flask-starter.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-image-offset – ./solutions/image-offset
solutions-image-offset-now-examples.vercel.app
solutions-image-offset-git-main-now-examples.vercel.app
solutions-image-offset.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
example-reduce-image-bandwidth-usage – ./solutions/reduce-image-bandwidth-usage
example-reduce-image-bandwidth-usage-git-main-now-examples.vercel.app
example-reduce-image-bandwidth-usage.vercel.app
example-reduce-image-bandwidth-usage-now-examples.vercel.app
solutions-reduce-image-bandwidth-usage.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-functions-news – ./starter/next-news
edge-functions-next-news.vercel.sh
edge-functions-news-now-examples.vercel.app
edge-functions-news-git-main-now-examples.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
example-auth-with-ory – ./solutions/auth-with-ory
example-auth-with-ory-vercel-solutions-vtest314.vercel.app
example-auth-with-ory.vercel.app
example-auth-with-ory-git-main-vercel-solutions-vtest314.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-functions-cookies – ./edge-middleware/cookies
edge-functions-cookies.vercel.app
edge-functions-cookies-git-main-now-examples.vercel.app
edge-functions-cookies-now-examples.vercel.app
edge-functions-cookies.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-script-component-strategies – ./solutions/script-component-strategies
solutions-script-component-strategies-git-main-now-examples.vercel.app
solutions-script-component-strategies-now-examples.vercel.app
solutions-script-component-strategies.vercel.app
solutions-script-component-strategies.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-combining-data-fetching-strategies – ./solutions/combining-data-fetching-strategies
solutions-combining-data-fetching-strat-git-21a392-now-examples.vercel.app
solutions-combining-data-fetching-strategies.vercel.app
solutions-combining-data-fetching-strategies-now-examples.vercel.app
solutions-combining-data-fetching-strategies.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-reuse-responses – ./solutions/reuse-responses
solutions-reuse-responses-now-examples.vercel.app
solutions-reuse-responses.vercel.app
solutions-reuse-responses-git-main-now-examples.vercel.app
solutions-reuse-responses.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-image-fallback – ./solutions/image-fallback
solutions-image-fallback-git-main-now-examples.vercel.app
solutions-image-fallback-now-examples.vercel.app
solutions-image-fallback.vercel.app
solutions-image-fallback.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-pagination-with-ssg – ./solutions/pagination-with-ssg
solutions-pagination-with-ssg-git-main-now-examples.vercel.app
solutions-pagination-with-ssg-kohl.vercel.sh
pagination-with-ssg.vercel.app
solutions-pagination-with-ssg.vercel.app
solutions-pagination-with-ssg-now-examples.vercel.app
solutions-pagination-with-ssg.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-user-agent-based-rendering – ./edge-middleware/user-agent-based-rendering
edge-user-agent-based-rendering-git-main-now-examples.vercel.app
edge-user-agent-based-rendering.vercel.app
edge-user-agent-based-rendering-now-examples.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-ab-testing-statsig – ./edge-middleware/ab-testing-statsig
edge-ab-testing-statsig-now-examples.vercel.app
edge-ab-testing-statsig.vercel.sh
edge-ab-testing-statsig.vercel.app
edge-ab-testing-statsig-git-main-now-examples.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-script-component-ad – ./solutions/script-component-ad
solutions-script-component-ad-now-examples.vercel.app
solutions-script-component-ad.vercel.app
solutions-script-component-ad-git-main-now-examples.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-loading-web-fonts – ./solutions/loading-web-fonts
solutions-loading-web-fonts-now-examples.vercel.app
solutions-loading-web-fonts-git-main-now-examples.vercel.app
solutions-loading-web-fonts.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-microfrontends – ./solutions/microfrontends/apps/main
solutions-microfrontends-git-main-now-examples.vercel.app
solutions-microfrontends-now-examples.vercel.app
solutions-microfrontends.vercel.app
microfrontends.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
solutions-microfrontends-docs – ./solutions/microfrontends/apps/docs
solutions-microfrontends-docs-now-examples.vercel.app
solutions-microfrontends-docs-git-main-now-examples.vercel.app
solutions-microfrontends-docs.vercel.app
solutions-microfrontends-docs.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
i18n – ./edge-middleware/i18n
i18n-now-examples.vercel.app
i18n-git-main-now-examples.vercel.app
middleware-i18n.vercel.app
i18n.vercel.sh
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-functions-streams – ./edge-functions/streams
edge-functions-streams-git-main-now-examples.vercel.app
edge-streams.vercel.app
edge-functions-streams-now-examples.vercel.app
example-streaming.vercel.app
edge-streaming.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
app-dir-i18n – ./app-directory/i18n
app-dir-i18n-git-main-now-examples.vercel.app
app-dir-i18n-now-examples.vercel.app
app-dir-i18n.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
app-dir-share-state – ./app-directory/share-state
app-dir-share-state-now-examples.vercel.app
app-dir-share-state.vercel.app
app-dir-share-state-git-main-now-examples.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
app-dir-css-in-js – ./app-directory/css-in-js
app-dir-css-in-js.vercel.app
app-dir-css-in-js-now-examples.vercel.app
app-dir-css-in-js-git-main-now-examples.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-edge-api-route-hello-world – ./edge-functions/hello-world-next
next-edge-api-route-hello-world-now-examples.vercel.app
next-edge-api-route.vercel.app
next-edge-api-route-hello-world-git-main-now-examples.vercel.app
next-edge-api-route-hello-world.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-middleware-modify-request-header – ./edge-middleware/modify-request-header
edge-middleware-modify-request-header-git-main-now-examples.vercel.app
edge-middleware-modify-request-header-now-examples.vercel.app
edge-middleware-modify-request-header.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
edge-geolocation-country-block – ./edge-middleware/geolocation-country-block
edge-geolocation-country-block-now-examples.vercel.app
edge-geolocation-country-block-git-main-now-examples.vercel.app
edge-geolocation-country-block.vercel.app
01f237d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nodejs-api – ./solutions/node-hello-world
nodejs-api-murex.vercel.app
nodejs-api-example.vercel.app
nodejs-api-now-examples.vercel.app
nodejs-api-git-main-now-examples.vercel.app