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

ng build stuck after successful build since sentryWebpack v2 #345

Open
johanneszelger opened this issue Jul 7, 2023 · 23 comments
Open

ng build stuck after successful build since sentryWebpack v2 #345

johanneszelger opened this issue Jul 7, 2023 · 23 comments

Comments

@johanneszelger
Copy link

Since i upgraded from the plugin v1 to v2, my angular build gets stuck after a successfull build:

Build at: 2023-07-07T10:40:52.046Z - Hash: cc2971c88cd12369 - Time: 32093ms

just won't end the process after this line. When i remove the plugin, the build ends normally. I tried the plugin versions 2.4 2.3 2.0, all unsuccessfull.

@niewicz
Copy link

niewicz commented Jul 12, 2023

I have the same problem on Angular 15 app, when I add sentry webpack plugin I see success for build and sourcemap upload, but the process is not finished
This makes the plugin not usable

@AbhiPrasad AbhiPrasad transferred this issue from getsentry/sentry-webpack-plugin Jul 13, 2023
@Lms24
Copy link
Member

Lms24 commented Jul 13, 2023

Hi, can you please share your plugin config? Do you get console output from the plugin regarding source maps upload or how many files were uploaded?

@johanneszelger
Copy link
Author

johanneszelger commented Jul 13, 2023

Sure, my config is:

plugins = [
  new webpack.DefinePlugin({
    "process.env.RELEASE": JSON.stringify(release),
    "process.env.BUILD": JSON.stringify(build)
  })
]

if (process.env.SENTRY_AUTH_TOKEN !== undefined && process.env.SENTRY_AUTH_TOKEN !== "") {
  console.log("adding sentry webpack because auth token was found, release: ", release)
  plugins.push(sentryWebpackPlugin({
    url: "url",
    org: "org",
    project: "frontend",

    authToken: process.env.SENTRY_AUTH_TOKEN,

    release: {
      name: release,
      finalize: false,
      cleanArtifacts: true,
      dist: build
    }
  }))
} else
  console.log("skipping sentry webpack because auth token was not found")

module.exports = {
  devtool: "source-map", // Source map generation must be turned on
  plugins: plugins,
  watch: false,
};

And yes i get output from the plugin, all sourcemaps are uploaded successfully, they are also visible on sentry. Everything is working - its just that my build pipeline gets stuck after the successfull build. If i cancel the process manually, everything works as expected.

@MitkoTschimev
Copy link

We have the same issue. It just doesn't end the webpack process

@MitkoTschimev
Copy link

MitkoTschimev commented Jul 17, 2023

I was able to pin it down to the dependency unplugin.
For a simple plugin with this dep on the newest version shows the same behavior

unjs/unplugin#323

@Lms24
Copy link
Member

Lms24 commented Jul 20, 2023

Thanks for investigating this @MitkoTschimev, appreciate the effort! Let's see if this can be fixed in unplugin. In the meantime, you might want to look into setting up Sentry-CLI to upload your source maps as a workaround.

@MitkoTschimev
Copy link

MitkoTschimev commented Jul 20, 2023

It is unsuitable for us because we use service workers with angular. The service worker works based on the content hash value of artifacts. if we manipulate the files afterwards, they are not matching anymore.

This is the advantage of the webpack plugin.

we use at the moment version 1.x and its fine for us

@lforst
Copy link
Member

lforst commented Jul 24, 2023

I am contemplating whether we should just remove unplugin entirely. In the beginning, I thought it was a good idea to abstract away all the bundler intricacies but by now many of the injection flows are different anyhow. I believe we're operating too low-level for unplugin to be effective. It would be a medium refactor but one dependency less.

@github-actions
Copy link

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@johanneszelger
Copy link
Author

I am contemplating whether we should just remove unplugin entirely. In the beginning, I thought it was a good idea to abstract away all the bundler intricacies but by now many of the injection flows are different anyhow. I believe we're operating too low-level for unplugin to be effective. It would be a medium refactor but one dependency less.

Is there any news yet?

@Lms24
Copy link
Member

Lms24 commented Aug 23, 2023

Hi, no news at this time. We're not gonna get to this this week. Maybe next week we can look into fixing this quickly in unplugin. Moving away from unplugin is a larger task I'm afraid and we're currently completely packed with tasks and projects.

@github-actions
Copy link

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@niewicz
Copy link

niewicz commented Sep 27, 2023

Any updates?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Sep 27, 2023
@lforst
Copy link
Member

lforst commented Sep 29, 2023

No updates. I think we are soft-blocked by unjs/unplugin#323. We could remove the unplugin dependency but it would result in quite a bit of work which we don't have the cycles for right now :(

@getsantry getsantry bot removed the status in GitHub Issues with 👀 Sep 29, 2023
@krema
Copy link

krema commented Dec 12, 2023

Any updates?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Dec 12, 2023
@lforst
Copy link
Member

lforst commented Dec 12, 2023

@krema Not yet. You can use Sentry CLI to upload source maps for now. There also seems to be an issue with angular and esbuild in general. #351

@rgant
Copy link

rgant commented Feb 6, 2024

The documentation currently says to do what doesn't work. https://docs.sentry.io/platforms/javascript/guides/angular/sourcemaps/uploading/angular-webpack/

If there isn't bandwidth to remove unplugin, perhaps there is bandwidth to update the documentation with an alternative setup?

Because otherwise I will continue to use "@sentry/webpack-plugin": "^1.21.0", until this is resolved.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Feb 6, 2024
@lforst
Copy link
Member

lforst commented Feb 6, 2024

@rgant Using "@sentry/webpack-plugin": "^1.21.0" is perfectly fine!

@Agrumas
Copy link

Agrumas commented Mar 26, 2024

Any news? This occurs to us too, however downgrading to ^1.21.0 isn't an option

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Mar 26, 2024
@lforst
Copy link
Member

lforst commented Mar 26, 2024

@Agrumas No news.

@salonmonster
Copy link

This is still an issue.
I've rolled back to ^1.21.0 for now, but wasted a good while trying to track this down :(

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Aug 6, 2024
@gerbermichi
Copy link

Our workaround is to use the sentry-cli to upload the sourcemap with a specific release:
Associating release with Artifact Bundle

@andreiborza
Copy link
Member

Yes, so the workaround is either to downgrade or to use sentry-cli. We are thinking of refactoring unplugin out but have not yet committed to it.

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

No branches or pull requests