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.

Build fails if manifest is enabled

See original GitHub issue

Describe the bug

The build fails if manifest: true otherwise it succeeds.

System Info

  • vite version:
  • Operating System: macOS 11.2.1
  • Node version: v15.8.0
  • Package manager (npm/yarn/pnpm) and version: npm 7.5.0

Logs (Optional if provided reproduction)

0 verbose cli [
0 verbose cli   '/opt/homebrew/Cellar/node/15.8.0/bin/node',
0 verbose cli   '/opt/homebrew/bin/npm',
0 verbose cli   'run',
0 verbose cli   'build'
0 verbose cli ]
1 info using npm@7.5.0
2 info using node@v15.8.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 0ms
5 timing config:load:builtin Completed in 0ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/myname/Work/my-project-5.7/build-backend/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/Users/myname/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 3ms
19 verbose npm-session ad80065efcdd99f7
20 timing npm:load Completed in 5ms
21 timing command:run-script Completed in 1625ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (node:events:378:20)
22 verbose stack     at maybeClose (node:internal/child_process:1067:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
23 verbose pkgid build-backend@0.0.0
24 verbose cwd /Users/myname/Work/my-project-5.7/build-backend
25 verbose Darwin 20.3.0
26 verbose argv "/opt/homebrew/Cellar/node/15.8.0/bin/node" "/opt/homebrew/bin/npm" "run" "build"
27 verbose node v15.8.0
28 verbose npm  v7.5.0
29 error code 1
30 error path /Users/myname/Work/my-project-5.7/build-backend
31 error command failed
32 error command sh -c vite build
33 verbose exit 1

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.
> vite build --debug

  vite:config bundled config file loaded in 70ms +0ms
  vite:config using resolved config: {
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object], [Object] ] },
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:dynamic-import-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:vue',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:manifest',
  vite:config     'vite:reporter'
  vite:config   ],
  vite:config   root: '/Users/myname/Work/my-project-5.7',
  vite:config   base: '/dist/',
  vite:config   build: {
  vite:config     target: 'es2017',
  vite:config     polyfillDynamicImport: true,
  vite:config     outDir: '/Users/myname/Work/my-project-5.7/application/js/dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: false,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: { input: [Object], external: [Array] },
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: true,
  vite:config     manifest: true,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     brotliSize: true,
  vite:config     chunkSizeWarningLimit: 500
  vite:config   },
  vite:config   optimizeDeps: {
  vite:config     exclude: [
  vite:config       'lodash-es',
  vite:config       '@amcharts/amcharts4/core',
  vite:config       '@amcharts/amcharts4/charts',
  vite:config       'axios',
  vite:config       'mitt'
  vite:config     ]
  vite:config   },
  vite:config   server: { cors: true, strictPort: true, port: 3000 },
  vite:config   define: { __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false },
  vite:config   ssr: { external: [ 'vue', '@vue/server-renderer' ] },
  vite:config   configFile: '/Users/myname/Work/my-project-5.7/build-backend/vite.config.js',
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   publicDir: '/Users/myname/Work/my-project-5.7/public',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   optimizeCacheDir: '/Users/myname/Work/my-project-5.7/node_modules/.vite',
  vite:config   env: { BASE_URL: '/dist/', MODE: 'production', DEV: false, PROD: true },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   },
  vite:config   createResolver: [Function: createResolver]
  vite:config } +2ms
building for production...
✓ 33 modules transformed.
rendering chunks (8)...error during build:
TypeError: Cannot read property 'facadeModuleId' of undefined
    at getChunkName (/Users/myname/Work/my-project-5.7/build-backend/node_modules/vite/dist/node/chunks/dep-074f1849.js:26828:27)
    at /Users/myname/Work/my-project-5.7/build-backend/node_modules/vite/dist/node/chunks/dep-074f1849.js:26854:73
    at Array.map (<anonymous>)
    at createChunk (/Users/myname/Work/my-project-5.7/build-backend/node_modules/vite/dist/node/chunks/dep-074f1849.js:26854:59)
    at Object.generateBundle (/Users/myname/Work/my-project-5.7/build-backend/node_modules/vite/dist/node/chunks/dep-074f1849.js:26871:53)
    at /Users/myname/Work/my-project-5.7/build-backend/node_modules/vite/node_modules/rollup/dist/shared/rollup.js:19041:25
npm ERR! code 1
npm ERR! path /Users/myname/Work/my-project-5.7/build-backend
npm ERR! command failed
npm ERR! command sh -c vite build --debug

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sinnbeckcommented, Feb 25, 2021

Ziggy is indeed an external like the others. 👍

1reaction
elwynelwyncommented, Feb 24, 2021

I had the same issue. Couldn’t get it running in CodeSandbox but hopefully if you save it out and run it locally you’ll get the same issue: https://codesandbox.io/s/jovial-smoke-gqk7y

If not, all I did was:

yarn create @vitejs/app
   // react-ts
yarn

Then edited the vite.config.ts to add basic rollup options for using external react+reactdom

build: {
    manifest: true,
    rollupOptions: {
      external: [
        'react',
         'react-dom'
        ],
      output: {
        globals: {
          react: 'React',
          'react-dom': 'ReactDOM'
        }
      }
    }
  }

Now when running yarn build I get the same facaceModuleId error as above ^^

Seems related to external rather than global

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build failed with error" Manifest file at 'obj\Debug\net6.0 ...
When testing the VS on 17.3.4, I get build errors with Android and MAUI Blazor: File | New | MAUI Blazor; Rebuild Solution;...
Read more >
Manifest and Build Errors - android - Stack Overflow
The problem is that your build uses both the old com.android.support namespace as well as the new androidx namespace.
Read more >
when build project error manifest display why and how to ...
when build desktop app work in csharp I get error manifest why and how to solve ... Error Unable to create a manifest...
Read more >
SPM fails to parse manifest with no error - Swift Forums
I'm using the 5.3 release version of the CentOS 7 swift bundle with the package.swift file shown below. I can build this on...
Read more >
Manage manifest files - Android Developers
When building your app, the Gradle build merges all manifest files into a ... the results of your merged manifest and find conflict...
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