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

Invalid source maps generated #364

Open
wagenet opened this issue Sep 18, 2020 · 10 comments
Open

Invalid source maps generated #364

wagenet opened this issue Sep 18, 2020 · 10 comments

Comments

@wagenet
Copy link
Member

wagenet commented Sep 18, 2020

We're seeing situations where we get source maps with negative line numbers. I believe it only occurs in some of our TypeScript files. I hope to add more details to this ticket, but wanted to get something started for reference.

@wagenet
Copy link
Member Author

wagenet commented Sep 18, 2020

Our primary version is 7.22.1.

@wagenet
Copy link
Member Author

wagenet commented Sep 22, 2020

Looks like we are seeing this in some non-TS files as well.

@rwjblue
Copy link
Member

rwjblue commented Oct 14, 2020

@wagenet - Is this restricted to component files that are using colocation?

@wagenet
Copy link
Member Author

wagenet commented Oct 14, 2020

@rwjblue we are using colocation, but I'm not sure whether it is restricted to those only. I'll keep an eye out.

@rwjblue
Copy link
Member

rwjblue commented Oct 14, 2020

@wagenet - I was thinking about this PR where someone mentioned that the way we do colocation breaks things with sourcemaps ember-cli/ember-cli-htmlbars#558.

@wagenet
Copy link
Member Author

wagenet commented Oct 15, 2020

@rwjblue it certainly seems plausible.

@wagenet
Copy link
Member Author

wagenet commented Oct 15, 2020

The interesting thing for us is that it doesn't happen in every situation. The problem as described in ember-cli-htmlbars sounds like it would always be an issue.

@bartocc
Copy link

bartocc commented Oct 15, 2020

@rwjblue I just found this issue while setting up breakpoints in VSCode and I believe this is indeed related to template co-location.

I've got a bare 3.21 app with 3 components in it

ember generate component -fs --with-component-class component-with-flat-structure
ember generate component -cs --with-component-class component-with-classic-structure
ember generate component -ns --with-component-class component-with-namespace-structure

babel: { sourceMaps: 'inline' } has been added to ember-cli-build.js.

The sourcemaps seems to be wrong for components component-with-flat-structure and component-with-namespace-structure and correct for component-with-classic-structure

I can setup a demo repo if necessary 👍

@bartocc
Copy link

bartocc commented Oct 15, 2020

@bartocc
Copy link

bartocc commented Oct 15, 2020

ember-cli/ember-cli-htmlbars#558 does fix the issue 👍

Edit

PR 558 does not perfectly correct the issue. To paraphrase @rwjblue in comment ember-cli/ember-cli-htmlbars#558 (comment)

We have to do something smarter than simply inserting the string contents

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