contentlayerdev / contentlayerdev/contentlayer

Error when building with contentlayer 0.3.4 and Next.js 13 App Router

Open
#506 84 comments 47 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.5k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

# When I run `pnpm contentlayer build`, I run into an error within node_modules and cannot resolve it.

Versions
```json
"contentlayer": "^0.3.4",
"next": "13.4.9",
```

Error Message
```
import { ConsoleSpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'ConsoleSpanExporter' not found. The requested module '@opentelemetry/sdk-trace-base' 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 '@opentelemetry/sdk-trace-base';
const { ConsoleSpanExporter, SimpleSpanProcessor } = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.