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

Source map location error #7655

Closed
eco747 opened this issue Feb 4, 2022 · 6 comments
Closed

Source map location error #7655

eco747 opened this issue Feb 4, 2022 · 6 comments

Comments

@eco747
Copy link

eco747 commented Feb 4, 2022

Parcel 2 / typescript 4.5 / windows 10

multiline comments between methods in a class are not taken in account in the generated .map file

example 1:

// initial code
class MyClass {
	test( ) {
		debugger;                              //<<<< debugger stops here : normal
		console.log( 'here' );
	}
}

const t = new MyClass( );
t.test( );
// new code
class MyClass {
        /*
         * I have just added these
         * lines of comment.
         * chrome will stop far away from the correct position
         * this is due to a bad file mapping. (from js to ts)
         */

	test( ) {
		debugger;                              
		console.log( 'here' );
	}
}

const t = new MyClass( );  //<<<< debugger stops here : abnormal
t.test( );
// BUT
class MyClass {
        // with these single line comments
        // everything is ok

	test( ) {
		debugger;         //<<<< debugger stops here : normal                     
		console.log( 'here' );
	}
}

const t = new MyClass( );  
t.test( );

demo.zip

Thanks
Etienne

@eco747
Copy link
Author

eco747 commented Feb 4, 2022

finally, It seems that all ml comments are problematic... everywhere in sources not only between methods

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Aug 10, 2022
@mischnic
Copy link
Member

I just tried the reproduction and it appears to be working fine with Parcel 2.2.1

@github-actions github-actions bot removed the Stale Inactive issues label Aug 24, 2022
@zealvurte
Copy link

I'm using parcel 2.6.2 and it happens. 🤷‍♂️ I don't have anything I can contribute to a reproducible test case though.

@Duckers
Copy link

Duckers commented Dec 30, 2022

Using Parcel 2.6.0 and it is still broken.

However, a work-around can be found here: https://www.npmjs.com/package/parcel-transformer-tsc-sourcemaps

@mischnic
Copy link
Member

mischnic commented Jan 1, 2023

PR to fix this: #8734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants