question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: name is not defined

See original GitHub issue

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/remix

SDK Version

7.6.0

Framework Version

7.6.0

Link to Sentry event

https://sentry.io/organizations/syncwith/issues/3415220654/?project=5880203&query=is%3Aunresolved

Steps to Reproduce

I am trying out sentry-remix for the first time, and now when my app encounters a 404 it seems like our 404 page doesn’t get used, and I get an unexpected exception tracked to sentry

The error seems to be in:

https://github.com/getsentry/sentry-javascript/blob/master/packages/remix/src/utils/instrumentServer.ts

Screen Shot 2022-07-10 at 11 43 03 AM Screen Shot 2022-07-10 at 11 43 32 AM

My app in root looks like:

function App() {
  const data = useLoaderData<RootLoaderData>();
  return (
    <Document data={data}>
      <Outlet />
      <footer></footer>
    </Document>
  );
}

export default withSentry(App);

Expected Result

I expected our normal 404 page to show, I think through the CatchBoundary

Actual Result

Screen Shot 2022-07-10 at 11 43 03 AM Screen Shot 2022-07-10 at 11 43 32 AM

Error: name is not defined File “/Users/alex/dev/micro/webapp/node_modules/@sentry/remix/cjs/utils/instrumentServer.js”, line 65, col 40, in <anonymous> captureRemixServerException(err, name); File “/Users/alex/dev/micro/webapp/node_modules/@remix-run/server-runtime/server.js”, line 393, col 18, in handleDocumentRequest return await handleDocumentRequest(request.clone(), responseStatusCode, responseHeaders, entryContext); File “/Users/alex/dev/micro/webapp/node_modules/@remix-run/server-runtime/server.js”, line 49, col 18, in requestHandler response = await handleDocumentRequest({ File “/Users/alex/dev/micro/webapp/node_modules/@sentry/remix/cjs/utils/instrumentServer.js”, line 134, col 16, in <anonymous> var res = (await origRequestHandler.call(this, request, loadContext)) ; File “/Users/alex/dev/micro/webapp/node_modules/@remix-run/express/server.js”, line 41, col 22, in <anonymous> let response = await handleRequest(request, loadContext);

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alexblackcommented, Jul 14, 2022

@AbhiPrasad ok thanks, I reverted to 7.5.1 to avoid this issue of sentry throwing errors on 404 pages

1reaction
AbhiPrasadcommented, Jul 11, 2022

@alexblack We have a couple more remix fixes to make, and then we’ll make another release! End of week by latest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
ReferenceError : "x" is not defined. The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
ReferenceError: $ is not defined - javascript - Stack Overflow
It's one of the common mistake everybody make while working with jQuery, Basically $ is an alias of jQuery() so when you try...
Read more >
How to Fix ReferenceError: Event is Not Defined in JavaScript
The Javascript ReferenceError is thrown when an attempt is made to reference a non-existing or out of scope variable. Not defining a variable...
Read more >
JavaScript ReferenceError - variable is not defined
This JavaScript exception variable is not defined occurs if there is a non-existent variable that is referenced somewhere. ... Cause of Error:.
Read more >
JavaScript ReferenceError – Variable is not Defined - Linux Hint
The JavaScript ReferenceError – Variable is not Defined is trying to access a variable using its identifier which has not been declared prior...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found