-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
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;
Activity
joshgoebel commentedon Apr 27, 2025
If you look at our sources you'll see we do export
default
fromlib
. This works fine for node... maybe file an issue with nuxt?You may want to try the CDN assets which include pure ES6 builds though.
https://www.npmjs.com/package/@highlightjs/cdn-assets