Skip to content

Can't Use exceptionless/react on Next.js project #103

Closed
@polluterofminds

Description

@polluterofminds

When trying to import the @exceptionless/react package in Next.js, the following error occurs:

SyntaxError: Named export 'fromError' not found. The requested module 'stacktrace-js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'stacktrace-js';
const { fromError } = pkg;

Steps to reproduce:

  1. npx create-next-app app-name
  2. npm i @exceptionless/react
  3. in pages/index.js add the import line at the top: import { Exceptionless } from "@exceptionless/react";

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions