web-extension-starter icon indicating copy to clipboard operation
web-extension-starter copied to clipboard

js sourcemaps are not generated

Open arnaumanyosa opened this issue 4 years ago • 15 comments

I'm aware of the previous issue

not sure how the fix worked for you, when basically you are telling webpack not to generate them.

arnaumanyosa avatar Jul 12 '21 14:07 arnaumanyosa

Using

new webpack.SourceMapDevToolPlugin({filename: false}),

plugin.

Do compare your webpack config against the current version in the respective branch and make the necessary changes.

abhijithvijayan avatar Jul 13 '21 17:07 abhijithvijayan

broken somewhere along the way, checking this now.

there is a known issue in firefox

another reference: https://github.com/webpack/webpack/issues/2145#issuecomment-294361203

abhijithvijayan avatar Jul 17 '21 14:07 abhijithvijayan

resolved?

abhijithvijayan avatar Nov 27 '21 16:11 abhijithvijayan

Not resolved

arnaumanyosa avatar Nov 28 '21 17:11 arnaumanyosa

I don't get any source maps neither using new webpack.SourceMapDevToolPlugin({filename: false})

came avatar Feb 03 '22 08:02 came

same issue here.

I enabled sourceMap: true in tsconfig.json and devtool: 'source-map' in webpack.config.js

it is generating .map files, however these only contain a single file, f.e.:

{"version":3,"sources":[],"names":[],"mappings":"","file":"js/contentScript.bundle.js","sourceRoot":""}

so I suspect the issue is that it is generating the source map not from the source typescript files but from the generated javascript files.

the other issue is that enabling source-map in webpack is disabling minification via terser

lsmith77 avatar Jul 28 '22 09:07 lsmith77

this is a critical issue, will pick this up soon and get it fixed.

abhijithvijayan avatar Sep 26 '22 05:09 abhijithvijayan

will migrate to webpack 5 and see if this issue is persisting there. Webpack 5 has been out for sometime and is running without much issues these days.

there is a possibility that some of the plugins might not work in webpack 5, will be migrating that as well. also i would be upgrading to node 16.

The plugin / loader I created for this project also needs some migration for the webpack 5, i will be doing that as well. ref: https://github.com/abhijithvijayan/wext-manifest-webpack-plugin/issues/2

updates:

  • article to migrate to webpack 5 if any of your projects are using options in webpack config that are not part of this template repository

    https://webpack.js.org/migrate/5/

  • https://www.npmjs.com/package/optimize-css-assets-webpack-plugin is now recommending to use https://github.com/webpack-contrib/css-minimizer-webpack-plugin for webpack 5 support
  • https://www.npmjs.com/package/webpack-ext-reloader now replaces webpack-extension-reloader as the original package lacked support for webpack 5

abhijithvijayan avatar Sep 26 '22 16:09 abhijithvijayan

support for webpack 5 is added for wext-manifest-loader in 3.0.0

had run into issues with the plugin while migrating, hopefully i can pick it up today and wrap it up

abhijithvijayan avatar Sep 26 '22 19:09 abhijithvijayan

let me know if there is something to test or if you have a branch I can help on. I have to admit this isn't my main area of expertise but maybe I can still help work through some issues.

lsmith77 avatar Oct 13 '22 18:10 lsmith77

let me know if there is something to test or if you have a branch I can help on. I have to admit this isn't my main area of expertise but maybe I can still help work through some issues.

Thanks for the offer. I haven't forgotten about this issue. I have worked on the migration of the webpack plugin i wrote for this project but then there was complication as webpack 5 introduced some new apis and deprecated the api i was using there.

I will try n pick this up soon as well. Been caught up with work hence I couldnt get this done sooner.

Thanks for the patience. Will revert back with updates.

abhijithvijayan avatar Oct 17 '22 20:10 abhijithvijayan

Have migrated the webpack plugin as well. Will be testing it properly before going for a release. Will keep updating here.

abhijithvijayan avatar Oct 27 '22 16:10 abhijithvijayan

any update? can we help with testing?

lsmith77 avatar Nov 24 '22 12:11 lsmith77

hello. happy new year!

I wonder if you are still motivated to look into this topic? thank you.

lsmith77 avatar Jan 04 '23 13:01 lsmith77

Alright, not sure if solving the issue also required some other dependency updates but it is now working for us by simply removing SourceMapDevToolPlugin and setting devtool to inline-source-map or source-map.

lsmith77 avatar Jul 08 '23 11:07 lsmith77