{"id":21602,"library":"named-exports-db","title":"named-exports-db","description":"A database of packages that require named exports when bundled with Rollup's @rollup/plugin-commonjs. It lists packages that export CommonJS modules where named exports cannot be statically analyzed, necessitating explicit configuration. Version 0.1.6 is the latest and only stable release; the package is largely a reference list with no active development. Differentiator: serves as a community-maintained lookup for Rollup bundling issues, unlike alternatives that are runtime-based or plugin-specific.","status":"maintenance","version":"0.1.6","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install named-exports-db","lang":"bash","label":"npm"},{"cmd":"yarn add named-exports-db","lang":"bash","label":"yarn"},{"cmd":"pnpm add named-exports-db","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package provides a default export (a Map-like object). CommonJS require works but ESM import is recommended for Rollup users.","wrong":"const namedExportsDb = require('named-exports-db')","symbol":"namedExportsDb","correct":"import namedExportsDb from 'named-exports-db'"},{"note":"Named export available; the package exports both a default (the database) and named helpers. CommonJS destructuring works but may confuse bundlers.","wrong":"const { getNamedExports } = require('named-exports-db')","symbol":"getNamedExports","correct":"import { getNamedExports } from 'named-exports-db'"},{"note":"Alternate named export for the database object. Avoid conflating with default export.","wrong":"import db from 'named-exports-db'; const { db } = db;","symbol":"db","correct":"import { db } from 'named-exports-db'"}],"quickstart":{"code":"import { getNamedExports, db } from 'named-exports-db';\n\n// Check if a package is in the database\nconst pkgName = 'some-commonjs-package';\nif (db.has(pkgName)) {\n  const exports = getNamedExports(pkgName);\n  console.log(`Named exports for ${pkgName}:`, exports);\n} else {\n  console.log(`${pkgName} not found. You may need to manually configure named exports in @rollup/plugin-commonjs.`);\n}\n\n// Example for Rollup configuration\n// rollup.config.js\n// import commonjs from '@rollup/plugin-commonjs';\n// export default {\n//   plugins: [commonjs({ namedExports: { [pkgName]: exports } })]\n// };","lang":"javascript","description":"Shows how to lookup a package's named exports and integrate with Rollup's commonjs plugin."},"warnings":[{"fix":"Use tools like https://rollupjs.org/guide/en/#rollupplugin-commonjs to detect missing named exports.","message":"The database may be incomplete or outdated; always verify with actual bundle analysis.","severity":"breaking","affected_versions":"all"},{"fix":"Pin version and test after updates.","message":"The package is not a substitute for understanding CommonJS interop; entries may change between versions without notice.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using @rollup/plugin-commonjs with 'requireReturnsDefault' option or newer bundlers.","message":"No active maintenance; the repository may be archived. Newer Rollup plugins handle some cases better.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Add the package and its exports to the 'namedExports' option in @rollup/plugin-commonjs, using data from named-exports-db.","cause":"The bundle contains a CommonJS module that cannot be statically analyzed.","error":"Could not determine named exports for module 'some-package'"},{"fix":"Run 'npm install named-exports-db' or 'yarn add named-exports-db'.","cause":"Package not installed or not found in node_modules.","error":"Error: Cannot find module 'named-exports-db'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}