vuejs/vue · error · Error
Entry "${entryName}" not found. Did you specify the correct
Error message
Entry "${entryName}" not found. Did you specify the correct entry option? What it means
Thrown by VueSSRServerPlugin when the entry chunk exists in stats.entrypoints but its assets, after filtering to JS, yield no usable string entry. This means entryAssets[0] is undefined or not a string — the webpack stats reported an entry with no JS asset. Distinct from error 16 (which fires when there are too many JS assets); here there are zero.
Source
Thrown at packages/server-renderer/src/webpack-plugin/server.ts:39
const entryInfo = stats.entrypoints[entryName]
if (!entryInfo) {
// #5553
return cb()
}
const entryAssets = entryInfo.assets.map(getAssetName).filter(isJS)
if (entryAssets.length > 1) {
throw new Error(
`Server-side bundle should have one single entry file. ` +
`Avoid using CommonsChunkPlugin in the server config.`
)
}
const entry = entryAssets[0]
if (!entry || typeof entry !== 'string') {
throw new Error(
`Entry "${entryName}" not found. Did you specify the correct entry option?`
)
}
const bundle = {
entry,
files: {},
maps: {}
}
Object.keys(compilation.assets).forEach(name => {
if (isJS(name)) {
bundle.files[name] = compilation.assets[name].source()
} else if (name.match(/\.js\.map$/)) {
bundle.maps[name.replace(/\.map$/, '')] = JSON.parse(
compilation.assets[name].source()
)
}View on GitHub (pinned to 9e88707940)
Solutions
- Check webpack config entry: it must point to a .js entry file that emits JS output.
- Inspect the emitted files in the output directory to confirm a JS entry was produced.
- If using webpack 5, ensure the server build actually emits the entry chunk (check for silent loader failures).
- Verify entrypoints in stats: log Object.keys(stats.entrypoints) and stats.entrypoints[entryName].assets.
Example fix
// before — entry points to non-JS or missing file
module.exports = {
entry: { app: './src/server-style.css' }
}
// after — entry points to the SSR JS entry
module.exports = {
entry: { app: './src/entry-server.js' }
} Defensive patterns
Strategy: validation
Validate before calling
// Before building, verify the entry config.
function assertEntryIsJs(config: any): void {
const entries = config.entry
const entryValues = typeof entries === 'string' ? [entries] : Object.values(entries)
for (const v of entryValues) {
const files = Array.isArray(v) ? v : [v]
if (!files.some((f: string) => /\.js$/.test(f))) {
throw new Error(`SSR entry must include a .js file; got ${files.join(', ')}`)
}
}
} Type guard
function entryResolvesToJs(config: any): boolean {
const e = config.entry
const flat = typeof e === 'string' ? [e] : Array.isArray(e) ? e : Object.values(e).flatMap(v => Array.isArray(v) ? v : [v])
return flat.some((f: string) => /\.([mc]?js|ts|tsx|jsx)$/.test(f))
} Try / catch
compiler.run((err, stats) => {
if (err && err.message.includes('not found. Did you specify the correct entry option')) {
console.error('Server entry not emitted. Check webpack entry path and loader chain.')
}
}) Prevention
- Point the server webpack entry to a .js (or transpiled .ts) file that emits JS.
- Confirm the output filename pattern produces a .js for the entry chunk.
- Run the SSR build and inspect the dist directory to confirm a JS entry was emitted.
- Log Object.keys(stats.toJson().entrypoints) after build to verify entry names.
When it happens
Trigger: Webpack server build emitted only non-JS assets for the entry (e.g. only a .json or .css), or the entry name in stats doesn't match any emitted JS file. Also possible when stats.entrypoints is keyed by an entry whose assets array is empty after the isJS filter.
Common situations: Webpack entry config points to a non-JS file or a file that produces no JS output. The entry key name was changed in config but the build references the old name. A webpack 5 stats format change causes assets to be nested differently. The build failed to emit JS due to a loader error that didn't fail the build.
Related errors
- bundle export should be a function when using { runInNewCont
- Server-side bundle should have one single entry file. Avoid
- \n\nVue packages version mismatch:\n\n- vue@${vueVersion}\n-
- Invalid JSON bundle file: ${bundle}
- Cannot locate bundle file: ${bundle}
AI-assisted analysis of vuejs/vue@9e88707940 (2026-08-11).
Data as JSON: /api/errors/1ec44122932b9805.
Report an issue: GitHub.