Skip to content

Why does next.js offen shows the wrong line/file when there's an error? #20776

@spmsupun

Description

@spmsupun

What version of Next.js are you using?

10.0.3

What version of Node.js are you using?

v12.20.1

What browser are you using?

Chrome

What operating system are you using?

Linux:Ubuntu

How are you deploying your application?

Ubuntu/Docker

Describe the Bug

When there's an error next js shows wrong line/file almost every time? is this normal behaviour?

Expected Behavior

Shows the correct file and the line number

To Reproduce

Create a next js application, throw an unhandled error related to the template.
ex: try to use an object as a component in a template:

import React from 'react';

const Test = () => (
  <div>
    {{ test: 'test' }}
  </div>
);

export default Test;

image

as per the above image, there is no attribute called type on pointed location, or the file. this very hard to debug.

This location is not even in the application's files:
image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions