Closed
Description
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:
- npx create-next-app app-name
- npm i @exceptionless/react
- in
pages/index.js
add the import line at the top:import { Exceptionless } from "@exceptionless/react";