Skip to content

@sentry/nextjs: Next.js build fails with Webpack 4 + next-offline #4133

Closed as not planned

Description

@jasonadkison

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other: @sentry/nextjs

Version:

6.14.1

Description

Ref: #3613

Our app uses Next.js v11 and Webpack 4. When building a service worker with workbox via next-offline, withSentryConfig causes our builds to fail with the following error:

You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer

We are not able to upgrade our project to Webpack 5, as was previously recommended.

Here's a link to the repo where the issue can be reproduced: https://github.com/jasonadkison/next-sentry-error/

Activity

  1. giulioambrogi commented on Feb 9, 2022

    @giulioambrogi

    any workaround while this is being looked at?

  2. self-assigned this
    on Jun 8, 2022
  3. onurtemizkan commented on Jun 9, 2022

    @onurtemizkan
    Contributor

    Hi @jasonadkison,

    I was able to reproduce the error in the project you provided, and deleting and recreating package-lock.json using npm@8.11.0 fixed it for me. Also, removing package-lock.json and using yarn instead worked well both locally and on Vercel.

    The issue seems originated from the dependency resolution of source-map package. That specific package-lock.json (lockfile version 1) somehow favours an earlier (buggy) version of it.

    Closing the issue, as I can't see a way to action this on the SDK side at the moment. But feel free to reopen if that doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions