Confirm Source Maps Have Been Built?

I updated to Meteor 2.3.2 and I’m getting some anomalies with my source maps.

Breakpoints stopped working. I thought at first it was an IDE issue and I contacted Jetbrains support (I use Jetbrains IntelliJ aka Webstorm). They said:

the log shows that some of your sourcemaps are broken (Cannot decode sourcemap null error indicates that null is passed as URL so the sourcemap can’t be resolved/processed).

I asked if I could just delete the sourcemaps and let IntelliJ rebuild them and they said:

No. Sourcemaps are not stored in .idea folder neither they are produced by the IDE; it’s your build procedure that creates sourcemaps while building your project,

So it seems like there may be an anomaly with Meteor building the source maps.

OTOH – in Chrome dev tools, breakpoints in my source code work fine, which seems to suggest that source maps are being generated.

Can anyone suggest some next steps I can take to look into this further?

The only place I’ve seen maps are in the production build which will not allow breakpoints or repl afaik that is only available in dev mode. But maybe someone else knows better. The source maps are all in the build tarball after the build finished you can untar it and look

Hmmm… I always thought source maps were used in development to enable e.g. the chrome dev tools to support break points in the original source file, rather than the built application. Not so?

I grepped to check and the only places with maps is the build dir and the node_modules ones that come from npm

The build directory – yes, that makes sense. Per this link,

A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.

So in development, source maps can be very useful.

Sourcemaps are saved under .meteor/local/build/programs/* during development

Thanks for this good info. I deleted everything from .meteor/local/build/programs and saw Meteor rebuild the contents. Also Chrome dev tools has no problem using these source maps to support break points on the original source files.

I’ve sent this info back to Jetbrains support and we’ll see what they say. I have a feeling I’m going to have to re-build the entire project from scratch to get Jetbrains breakpoints working again. They’ve offered to look at the project but of course there’s proprietary code in it so I can’t send it. :slight_smile: