Skip to content

[build] - esbuild Invalid loader value error when using chunkFileNames options #10147

@luckylooke

Description

@luckylooke

Describe the bug

When I use chunkFileNames option in rollupoptions

ibuild: {
    rollupOptions: {
      output: {
        entryFileNames: `[name].js`,
        assetFileNames: `assets/[name].[hash][extname]`,
        chunkFileNames: `chunks/[name].[hash]` //     <----------------- csuses error
      }
    }
  }

build crashes with following error:

[vite:esbuild-transpile] Invalid loader value: "0b5e7646"
error during build:
Error: Invalid loader value: "0b5e7646"
    at eval (/home/projects/vue3-vite-router-starter-7disn5/node_modules/esbuild/lib/main.js:1394:29)
    at eval (/home/projects/vue3-vite-router-starter-7disn5/node_modules/esbuild/lib/main.js:672:9)
    ...

Reproduction

https://stackblitz.com/edit/vue3-vite-router-starter-7disn5?file=vite.config.js

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^3.1.0 => 3.1.0 
    vite: ^3.1.1 => 3.1.1 

also on

  System:
    OS: macOS 12.5.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 1017.80 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 103.0.1
    Safari: 15.6.1
  npmPackages:
    @vitejs/plugin-vue: ^3.0.1 => 3.1.0 
    vite: ^3.0.1 => 3.1.1

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-edge-caseBug, but has workaround or limited in scope (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions