Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Module parse failed: Unexpected character '�' (1:0) #170

Open
@haydenbleasel

Description

@haydenbleasel

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

SDK Version

1.0.7

Link to Sentry event

No response

What environment is your node script running in?

  • Next.js 13 app using App Directory, using "@sentry/nextjs": "^7.57.0"
  • MacOS Ventura 13.4.1 (22F82)
  • Node v18.12.1

How is your code deployed and bundled?

Standard Next.js build process running on Vercel. Here's the abstracted next.config.js:

import { withSentryConfig } from '@sentry/nextjs';

/** @type {import('next').NextConfig} */
const nextConfig = {
  async rewrites() {
    return [
      {
        source: '/api/sentry/:path*',
        destination:
          'https://{x}.ingest.sentry.io/api/{y}/envelope/',
      },
    ];
  },
  sentry: {
    hideSourceMaps: true,
    tunnelRoute: '/api/sentry',
  },
};

/** @type {import('@sentry/nextjs').SentryWebpackPluginOptions} */
const sentryWebpackPluginOptions = {
  silent: true,
};

export default withSentryConfig(
  sentryWebpackPluginOptions
);

Steps to Reproduce

Following the installation instructions in the Sentry web UI, updated my sentry.server.config.js to the following:

import * as Sentry from '@sentry/nextjs';
import { ProfilingIntegration } from '@sentry/profiling-node';

Sentry.init({
  dsn: process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
  tracesSampleRate: 1.0,
  profilesSampleRate: 1.0,
  integrations: [
    new ProfilingIntegration(),
  ],
});

Deploy to Vercel which runs npm build.

Potential follow-on issue from #164

Expected Result

The build should pass.

Actual Result

19:12:21.256 |  Failed to compile.
19:12:21.256 |  
19:12:21.256 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-darwin-x64-93.node
19:12:21.256 | Module parse failed: Unexpected character '�' (1:0)
19:12:21.256 | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
19:12:21.257 | (Source code omitted for this binary file)
19:12:21.257 |  
19:12:21.257 | Import trace for requested module:
19:12:21.257 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-darwin-x64-93.node
19:12:21.257 | ./node_modules/@sentry/profiling-node/lib/index.js
19:12:21.257 | ./sentry.server.config.js
19:12:21.257 | ./app/layout.tsx
19:12:21.257 |  
19:12:21.257 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-darwin-x64-108.node
19:12:21.257 | Module parse failed: Unexpected character '�' (1:0)
19:12:21.257 | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
19:12:21.257 | (Source code omitted for this binary file)
19:12:21.257 |  
19:12:21.257 | Import trace for requested module:
19:12:21.257 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-darwin-x64-108.node
19:12:21.257 | ./node_modules/@sentry/profiling-node/lib/index.js
19:12:21.257 | ./sentry.server.config.js
19:12:21.258 | ./app/layout.tsx
19:12:21.258 |  
19:12:21.258 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-glibc-83.node
19:12:21.258 | Module parse failed: Unexpected character '�' (1:0)
19:12:21.258 | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
19:12:21.259 | (Source code omitted for this binary file)
19:12:21.259 |  
19:12:21.259 | Import trace for requested module:
19:12:21.259 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-glibc-83.node
19:12:21.259 | ./node_modules/@sentry/profiling-node/lib/index.js
19:12:21.259 | ./sentry.server.config.js
19:12:21.259 | ./app/layout.tsx
19:12:21.259 |  
19:12:21.259 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-glibc-93.node
19:12:21.259 | Module parse failed: Unexpected character '�' (1:0)
19:12:21.259 | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
19:12:21.259 | (Source code omitted for this binary file)
19:12:21.259 |  
19:12:21.259 | Import trace for requested module:
19:12:21.260 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-glibc-93.node
19:12:21.260 | ./node_modules/@sentry/profiling-node/lib/index.js
19:12:21.260 | ./sentry.server.config.js
19:12:21.260 | ./app/layout.tsx
19:12:21.260 |  
19:12:21.260 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-glibc-108.node
19:12:21.260 | Module parse failed: Unexpected character '�' (1:0)
19:12:21.260 | You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
19:12:21.260 | (Source code omitted for this binary file)
19:12:21.260 |  
19:12:21.260 | Import trace for requested module:
19:12:21.260 | ./node_modules/@sentry/profiling-node/lib/sentry_cpu_profiler-linux-arm64-glibc-108.node
19:12:21.260 | ./node_modules/@sentry/profiling-node/lib/index.js
19:12:21.260 | ./sentry.server.config.js
19:12:21.260 | ./app/layout.tsx
19:12:21.260 |  
19:12:21.260 |  
19:12:21.260 | > Build failed because of webpack errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions