Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite build freezes when using docker #428

Open
2 tasks done
RawToast opened this issue Dec 24, 2024 · 1 comment
Open
2 tasks done

Vite build freezes when using docker #428

RawToast opened this issue Dec 24, 2024 · 1 comment

Comments

@RawToast
Copy link

RawToast commented Dec 24, 2024

Describe the bug

With this plugin configured (only typescript checks), a dockerised build of vite reaches completion, but does not continue:

#36 9.522 - Using dynamic import() to code-split the application
#36 9.522 - Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
#36 9.522 - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
#36 9.523 ✓ built in 4.91s

https://github.com/RawToast/manjuu/actions/runs/12480361973/job/34831066817

It will just sit forever after completion and not proceed. Even if the check build flag is disabled. The only way I could get my project to build was to specifically disable this plugin:

/// <reference types="vitest" />
import { defineConfig } from 'vite'
import path from 'path'
import react from '@vitejs/plugin-react-swc'
import checker from 'vite-plugin-checker'

const isCi = process.env.NODE_ENV === 'ci'

const plugins = [
  react(),
  isCi
    ? null
    : checker({
        typescript: true
      })
]

export default defineConfig({
  plugins: plugins,
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  }
})

According to https://stackoverflow.com/questions/75839993/vite-build-hangs-forever it seems this has been a problem with other plugins

Reproduction

Have a dockerised build using vite, e.g. https://github.com/RawToast/manjuu/blob/master/frontend/Dockerfile

Try building it with docker-compose, e.g. https://github.com/RawToast/manjuu/blob/master/compose.ci.yml

Watch the build not get stuck after vite builds successfully. It should be reproducible by using this commit (pre removing the plugin via env) https://github.com/RawToast/manjuu/tree/afb12818550e55d83ae121bd80c547abcd4fc474

Expected behavior

Docker to build successfully

System Info

This also occurs on Circle Ubuntu images
Vite 6

System:
    OS: macOS 14.7
    CPU: (8) arm64 Apple M1
    Memory: 124.89 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - /opt/homebrew/opt/node@22/bin/node
    Yarn: 4.0.0 - /opt/homebrew/bin/yarn
    npm: 10.9.0 - /opt/homebrew/opt/node@22/bin/npm
    bun: 1.1.42 - /opt/homebrew/bin/bun
  npmPackages:
    vite-plugin-checker: ^0.8.0 => 0.8.0

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@RawToast RawToast changed the title Builds freeze in docker after completion Vite build freezes when using docker Dec 27, 2024
@RawToast
Copy link
Author

It seems this is avoidable by disabling the overlay in CI, see this PR for an example

Makes sense seeing as you won't be seeing it during a build! Unless it's already documented, it's probably worth mentioning in the docs and then closing this issue 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant