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

No source map generated by TypeScript plugin when specified in tsconfig.json #216

Closed
David-Else opened this issue Feb 19, 2020 · 12 comments
Closed

Comments

@David-Else
Copy link

David-Else commented Feb 19, 2020

  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 3.0.0
  • Rollup Version: 1.31.1
  • Operating System (or Browser): Linux
  • Node Version: 12

How Do We Reproduce?

https://repl.it/repls/ElaborateStingyParallelport

Press run

Expected Behavior

A sourcemap file should be generated in the output folder as it was "sourceMap": true, in the tsconfig.json

Actual Behavior

It is not, so debugging in the browser does not work properly.

@shellscape
Copy link
Collaborator

@David-Else thanks for the issue. Please see the issue template for instructions on providing a proper reproduction. What you've provided here is not, unfortunately.

@David-Else
Copy link
Author

@shellscape I spent a while on this, even making a script for you to make a complete environment to reproduce the issue.

Before I invest more time, please just quickly confirm that the plugin IS expected to create a sourcemap? Thanks.

@shellscape
Copy link
Collaborator

While appreciated, we do have instructions in the issue template to keep people on track with what we need to triage. I highly recommend paying close attention to other project's templates in the future.

The simple fact is that our time and resources are limited, and having to setup an environment, versus a REPL or repo link, eats into the time we have available to triage for folks who have followed the template.

@David-Else
Copy link
Author

David-Else commented Feb 19, 2020

@shellscape I have created this to demonstrate the bug:

https://repl.it/repls/ElaborateStingyParallelport

When I run it the file bundle.js is created, but no sourcemap. Is this OK for you to remove the 'no reproduction' flag? I have edited the original post too.

@shellscape
Copy link
Collaborator

Apologies if you felt that label was derogatory. It's only for maintainers for at-a-glance statuses.

Thanks for putting that together. That's going to be a huge help.

@David-Else
Copy link
Author

@shellscape Don't worry, I did not think the label was derogatory, I just wanted to help get the bug fixed asap :) Cheers, great plugin!

@NotWoods
Copy link
Member

You also need to add sourcemap: true to the Rollup output options. I'll also work on adding a warning when the Typescript option is on but not the corresponding Rollup option.

@NotWoods
Copy link
Member

NotWoods commented Mar 6, 2020

Waning added in version 4.0.0 of the typescript plugin

@HarelM
Copy link

HarelM commented Jul 12, 2023

I have this warning in my project - maplibre-gl-js although I use this sourcemap: 'inline' or true in the output.
The project is here:
https://github.com/maplibre/maplibre-gl-js
The warning can be seen when running npm run build-dev or npm run build-prod.
Let me know if you prefer I open a new issue on this.

maplibre-gl-js % npm run build-dev

> maplibre-gl@3.2.0 build-dev
> rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev

loaded rollup.config.ts with warnings
(!) Plugin typescript: @rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.
(node:31559) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

src/index.ts, src/source/worker.ts → staging/maplibregl...
created staging/maplibregl in 4.2s

build/rollup/maplibregl.js → dist/maplibre-gl-dev.js...

@HarelM
Copy link

HarelM commented Oct 24, 2023

Any update on the above?
No matter what I try I still get this warning in the build...
I also tried the following but it didn't work...
https://stackoverflow.com/questions/63128597/how-to-get-rid-of-the-rollup-plugin-typescript-rollup-sourcemap-option-must

Any help would be appreciated!

@lukastaegert
Copy link
Member

You are not getting this error from the build but from transpiling the config file:
loaded rollup.config.ts with warnings

Make sure to remove the sourceMap option from your tsconfig.json!

@HarelM
Copy link

HarelM commented Oct 25, 2023

Ah, great! Thanks for the tip!

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

5 participants