Skip to content

Nuxt3 Use npm run build "default" is not exported by "node_modules/highlight.js/lib/index.js" #4246

Open
@AABBCC-cloud

Description

@AABBCC-cloud

npm run build

build
nuxt build

Nuxt 3.16.2 with Nitro 2.11.8 nuxi 16:05:39
ℹ Building for Nitro preset: node-server nuxi 16:05:42
ℹ Building client... 16:05:50
ℹ vite v6.2.5 building for production... 16:05:50
ℹ ✓ 2339 modules transformed. 16:06:03

ERROR ✗ Build failed in 12.82s 16:06:03

[ nuxi 16:06:03] ERROR Nuxt Build Error: node_modules/highlight.js/es/index.js (2:7): "default" is not exported by "node_modules/highlight.js/lib/index.js", imported by "node_modules/highlight.js/es/index.js".
file: C:/Users/xkgoo/Desktop/starter/node_modules/highlight.js/es/index.js:2:7

1: // https://nodejs.org/api/packages.html#packages_writing_dual_packages_while_avoiding_or_minimizing_hazards
2: import HighlightJS from '../lib/index.js';
^
3: export { HighlightJS };
4: export default HighlightJS;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions