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

Support Vite 6+ #47

Open
2 tasks done
QuentiumYT opened this issue Feb 19, 2025 · 0 comments
Open
2 tasks done

Support Vite 6+ #47

QuentiumYT opened this issue Feb 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@QuentiumYT
Copy link
Contributor

Describe the Bug

Using vite 6.0 or 6.1, vite-plugin-image-optimizer cannot run because rootConfig is undefined. I works fine in vite 5.4

4 modules transformed.
dist/fonts/Outfit-Thin.woff2               13.22 kB
dist/fonts/Outfit-Medium.woff2             13.30 kB
dist/fonts/Outfit-Black.woff2              13.50 kB
dist/fonts/Outfit-ExtraLight.woff2         13.86 kB
dist/fonts/Outfit-Light.woff2              14.02 kB
dist/fonts/Outfit-ExtraBold.woff2          14.06 kB
dist/fonts/Outfit-Bold.woff2               14.06 kB
dist/fonts/Outfit-Regular.woff2            14.08 kB
dist/fonts/Outfit-SemiBold.woff2           14.10 kB
dist/fonts/RooneyPro-BoldItalic.woff2      44.72 kB
dist/fonts/RooneyPro-LightItalic.woff2     44.90 kB
dist/fonts/RooneyPro-BlackItalic.woff2     45.85 kB
dist/fonts/RooneyPro-MediumItalic.woff2    48.40 kB
dist/fonts/RooneyPro-RegularItalic.woff2   48.76 kB
dist/fonts/RooneyPro-HeavyItalic.woff2     48.91 kB
dist/images/draw-sprite.png               292.29 kB
dist/style.min.css                         37.88 kB │ gzip: 6.70 kB
dist/main.min.js                           12.82 kB │ gzip: 3.82 kB
✓ built in 2.48s
error during build:
TypeError: Cannot read properties of undefined (reading 'logger')
    at logOptimizationStats (file:///home/actimage/geode/node_modules/vite-plugin-image-optimizer/dist/index.mjs:88:14)
    at Object.closeBundle (file:///home/actimage/geode/node_modules/vite-plugin-image-optimizer/dist/index.mjs:321:9)
    at Object.handler (file:///home/actimage/geode/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:52529:15)
    at file:///home/actimage/geode/node_modules/rollup/dist/es/shared/node-entry.js:21835:40
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Promise.all (index 0)
    at async PluginDriver.hookParallel (file:///home/actimage/geode/node_modules/rollup/dist/es/shared/node-entry.js:21763:9)
    at async Object.close (file:///home/actimage/geode/node_modules/rollup/dist/es/shared/node-entry.js:22741:13)
    at async buildEnvironment (file:///home/actimage/geode/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:52244:17)
    at async Object.defaultBuildApp [as buildApp] (file:///home/actimage/geode/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:52684:5)
error: script "build" exited with code 1 

Steps to reproduce

  1. Install both vite >=6 and latest version of this plugin
  2. Run a build

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (6) x64 13th Gen Intel(R) Core(TM) i7-1370P
    Memory: 5.24 GB / 15.62 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 22.13.1 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 11.1.0 - /usr/bin/npm
    pnpm: 9.15.0 - /usr/bin/pnpm
    bun: 1.2.2 - /usr/bin/bun
  npmPackages:
    vite: ^6.1 => 6.1.1 
    vite-plugin-image-optimizer: ^1.1 => 1.1.8

Used Package Manager

npm

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@QuentiumYT QuentiumYT added the bug Something isn't working label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant