Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: document is not defined in 6.13.0 #3997

Closed
5 of 9 tasks
mitchell-bu opened this issue Sep 21, 2021 · 1 comment
Closed
5 of 9 tasks

ReferenceError: document is not defined in 6.13.0 #3997

mitchell-bu opened this issue Sep 21, 2021 · 1 comment

Comments

@mitchell-bu
Copy link

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other: @sentry/webpack-plugin

Version:

`@sentry/browser` - 6.13.0
`@sentry/webpack-plugin` - 1.17.1

Description

I am using Sentry with a NextJS project. For various reasons, we're still using NextJS v10 and webpack v4 in our project. When upgrading from 6.12.0 to 6.13.0 or 6.13.1, we're getting ReferenceError: document is not defined in Sentry.init() both in development mode and when building.

Here's the full trace:

ReferenceError: document is not defined
    at FetchTransport.BaseTransport (/home/casted/src/app/node_modules/@sentry/browser/dist/transports/base.js:25:47)
    at new FetchTransport (/home/casted/src/app/node_modules/@sentry/browser/dist/transports/fetch.js:78:28)
    at BrowserBackend._setupTransport (/home/casted/src/app/node_modules/@sentry/browser/dist/backend.js:43:20)
    at BrowserBackend.BaseBackend (/home/casted/src/app/node_modules/@sentry/core/dist/basebackend.js:15:32)
    at new BrowserBackend (/home/casted/src/app/node_modules/@sentry/browser/dist/backend.js:15:42)
    at BrowserClient.BaseClient (/home/casted/src/app/node_modules/@sentry/core/dist/baseclient.js:52:25)
    at new BrowserClient (/home/casted/src/app/node_modules/@sentry/browser/dist/client.js:35:24)
    at Object.initAndBind (/home/casted/src/app/node_modules/@sentry/core/dist/sdk.js:18:18)
    at Object.init (/home/casted/src/app/node_modules/@sentry/browser/dist/sdk.js:93:12)
    at Module.1TCz (/home/casted/src/app/.next/server/pages/_app.js:125:53)
    at __webpack_require__ (/home/casted/src/app/.next/server/pages/_app.js:23:31)
    at Object.0 (/home/casted/src/app/.next/server/pages/_app.js:99:18)
    at __webpack_require__ (/home/casted/src/app/.next/server/pages/_app.js:23:31)
    at /home/casted/src/app/.next/server/pages/_app.js:91:18
    at Object.<anonymous> (/home/casted/src/app/.next/server/pages/_app.js:94:10)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
@kamilogorek
Copy link
Contributor

The fix should be already live. Sorry for the inconvinience.

@smeubank smeubank added this to the Client Reports milestone Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants