question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enabling vite manifest build option fails

See original GitHub issue

I dont know if it is related with vitesse, vite-ssg or just a vite problem: the problem occurs when enabling manifest on buildOptions.

There is a PR 2353 merged on vite 2.0.5, but updating vite on vitesse project, just still fails when building (I removed node_modules/.vite and .vite-ssg-temp directories):

vite --version
vite/2.0.5 win32-x64 node-v15.5.1
pnpm version
{
  npm: '7.3.0',
  node: '15.5.1',
  v8: '8.6.395.17-node.23',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.17.1',
  modules: '88',
  nghttp2: '1.41.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1i',
  cldr: '38.0',
  icu: '68.1',
  tz: '2020b',
  unicode: '13.0'
}

Output:

[vite-ssg] Build for client...
vite v2.0.5 building for production...
✓ 78 modules transformed.
dist/index.html                    1.11kb
dist/manifest.webmanifest          0.38kb
dist/registerSW.js                 0.13kb
dist/manifest.json                 1.68kb
dist/ssr-manifest.json             3.76kb
dist/assets/README.9913d926.js     1.15kb / brotli: 0.40kb
dist/assets/about.21ce0002.js      1.57kb / brotli: 0.57kb
dist/assets/[...all].b7157a5a.js   0.25kb / brotli: 0.18kb
dist/assets/[name].d94b4499.js     1.38kb / brotli: 0.71kb
dist/assets/404.5267aea9.js        1.10kb / brotli: 0.55kb
dist/assets/home.808072ce.js       0.36kb / brotli: 0.23kb
dist/assets/app.e9e410c2.css       17.50kb / brotli: 3.54kb
dist/assets/app.f4fff1a1.js        46.27kb / brotli: 13.60kb
dist/assets/vendor.11987bd3.js     75.35kb / brotli: 26.17kb
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.

[vite-ssg] Build for server...
vite v2.0.5 building SSR bundle for production...
✓ 45 modules transformed.
rendering chunks (1)...TypeError: Cannot read property 'facadeModuleId' of undefined
    at getChunkName (XXX\node_modules\.pnpm\vite@2.0.5\node_modules\vite\dist\node\chunks\dep-e0f09032.js:26966:27)
    at XXX\node_modules\.pnpm\vite@2.0.5\node_modules\vite\dist\node\chunks\dep-e0f09032.js:26992:73
    at Array.map (<anonymous>)
    at createChunk (XXX\node_modules\.pnpm\vite@2.0.5\node_modules\vite\dist\node\chunks\dep-e0f09032.js:26992:59)
    at Object.generateBundle (XXX\node_modules\.pnpm\vite@2.0.5\node_modules\vite\dist\node\chunks\dep-e0f09032.js:27009:53)
    at XXX\node_modules\.pnpm\rollup@2.40.0\node_modules\rollup\dist\shared\rollup.js:19049:25
    at processTicksAndRejections (node:internal/process/task_queues:93:5) {
  code: 'PLUGIN_ERROR',
  plugin: 'vite:manifest',
  hook: 'generateBundle'
}
 ERROR  Command failed with exit code 1.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
hannoerucommented, Mar 6, 2021

Try this one manifest: !process.env.VITE_SSG, to only generate manifest in client build.

0reactions
userquincommented, Mar 6, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Build fails if manifest is enabled · Issue #2006 · vitejs/vite
Describe the bug The build fails if manifest: true otherwise it succeeds. System Info vite version: Operating System: macOS 11.2.1 Node ...
Read more >
Build Options - Vite
Note the build will fail if the code contains features that cannot be safely transpiled by esbuild. See esbuild docs for more details....
Read more >
Vite manifest not found - Stack Overflow
Maybe you need to change your build directory in vite config,, open vite.config.js and add under input array buildDirectory: '../../public/build ...
Read more >
Vite manifest not found at - Laracasts
I have this error Vite manifest not found at: /home/vagrant/gps-system/public/build/manifest.json I looked online and found that I was just supposed to npm ...
Read more >
Vite plugin for Craft CMS - nystudio107
Vite supports both modern and legacy bundle builds, as per the Deploying ... your manifest.json that should be injected into Twig error templates,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found