question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sourcemap bundled 0 files for upload (typescript & nextjs)

See original GitHub issue

Looking to debug what’s going wrong here;

We’re using next and typescript. Also using @zeit/next-source-maps to compile sourcemaps (by default it sets devtools: source-map:

Output:
Creating an optimized production build ...> Rewriting sources
> Adding source map references
> Bundled 0 files for upload
> Uploaded release files to Sentry
> File upload complete

Source Map Upload Report
Creating an optimized production build .> Rewriting sources
> Adding source map references
> Bundled 0 files for upload
> Uploaded release files to Sentry
> File upload complete
Creating an optimized production build .
Source Map Upload Report
Creating an optimized production build

Seems like 0 files are being bundled here

webpack config:
const withSourceMaps = require('@zeit/next-source-maps');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.BUNDLE_ANALYZE === '1',
});
const SentryWebpackPlugin = require('@sentry/webpack-plugin');

module.exports = withBundleAnalyzer({
  ...withSourceMaps({
    webpack(config, options) {
      ...

      if (process.env.SENTRY_RELEASE === '1') {
        config.plugins.push(
          new SentryWebpackPlugin({
            include: '.',
            ignore: [
              '.sentrycli',
              'node_modules',
              'public',
              'styles',
              '*.config.js',
              'next.config.runtime.js',
              'utils/external/FullStory/loadFullStory.js',
            ],
          }),
        );
      }

      return config;
    },
  }),
  ...
});
tsconfig.json
{
  "compileOnSave": false,
  "compilerOptions": {
    ...
    "sourceMap": true,
    "inlineSources": true,
    "sourceRoot": "/",
    "baseUrl": ".",
    "typeRoots": ["./node_modules/@types", "./types/"],
    "paths": {
      "~/*": ["./*"]
    },
    ...
  },
  "include": ["./**/*"],
  "exclude": [".next/**/*", "server/**/*", "node_modules/**/*"]
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
zyqxdcommented, Apr 27, 2020

Perfect!

We had some reports of include: '.' not handling dot-directories correctly. Can you try to explicitly add .next to it? Thanks!

include: ['.', '.next']
1reaction
AssisrMatheuscommented, Jul 6, 2020

@kamilogorek I think the path should at least be decoded before the service tries to match it with the source files. I submitted https://github.com/getsentry/sentry/issues/19713 for that. Thank you for your support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Source Maps for Next.js
When uploading artifacts to Sentry, you must name your source map files with the value the file resolves to. That is, if your...
Read more >
Advanced Features: Source Maps | Next.js
Enables browser source map generation during the production build. ... the source maps will be output in the same directory as the JavaScript...
Read more >
Bundle Typescript files from dependent module for debugging ...
js and I want to be able to debug it (either in Chrome Dev Tools or in Intellij). I'm trying to bundle TS...
Read more >
Source Maps - Rollbar Docs
Upload Option 2: Let Rollbar automatically download your source map file ... if (trace && trace.frames) { for (var i = 0; i...
Read more >
file-loader - webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found