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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite-plugin-compression module missing when building the app #2

Closed
BenjaminOddou opened this issue Jul 20, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@BenjaminOddou
Copy link

Hello 馃憢,

I encountered a bug with @nuxt-modules/compression (v0.1.0) when building the app with Nuxt 3 (v3.0.0-rc.6) I have this error message :

Nuxt CLI v3.0.0-rc.6                                                                                                                                                                                                                      11:28:46

 ERROR  Cannot find module 'vite-plugin-compression'                                                                                                                                                                                      11:28:48
Require stack:
- /Users/User/Documents/Nuxt3App/node_modules/@nuxt-modules/compression/dist/module.cjs

  Require stack:
  - node_modules/@nuxt-modules/compression/dist/module.cjs
  at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
  at Function.resolve (node:internal/modules/cjs/helpers:108:19)
  at _resolve (node_modules/jiti/dist/jiti.js:1:108226)
  at jiti (node_modules/jiti/dist/jiti.js:1:110413)
  at node_modules/@nuxt-modules/compression/dist/module.cjs:4:25
  at jiti (node_modules/jiti/dist/jiti.js:1:112282)
  at requireModule (node_modules/@nuxt/kit/dist/index.mjs:295:26)
  at normalizeModule (node_modules/@nuxt/kit/dist/index.mjs:448:53)
  at installModule (node_modules/@nuxt/kit/dist/index.mjs:431:47)
  at initNuxt (node_modules/nuxt/dist/index.mjs:1421:13)

I know that this plugin is based on vite-plugin-compression but I was wondering if it was needed to install this dependency as well.

My config :

// nuxt.config.ts|js

import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
  buildModules: [
    [
      '@nuxt-modules/compression',
      {
        algorithm: 'brotliCompress'
      },
    ],
  ],
})

Also I remarked that the following config was skipped on the latest release of Nuxt 3 (v3.0.0-rc.6):

// nuxt.config.ts|js

import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
  compression: {
    algorithm: 'brotliCompress',
  }
})
@BenjaminOddou BenjaminOddou added the bug Something isn't working label Jul 20, 2022
@BenjaminOddou
Copy link
Author

cc @Baroshem

@Baroshem
Copy link
Owner

Baroshem commented Oct 9, 2022

Hey,

First, thanks for letting me know. I developed this plugin long time ago (even Nuxt 3 was in beta back then and now it is in rc.11).

Since then, a lot of things have changed. In order to make the module work as expected, I think I would need to update it to the latest Nuxt format. The issue with the dependency seems to be caused by the fact that it is installed as a dev dep and the it is required in your app as it is a vite plugin.

To fix this, I will refactor the module, change the dependency and probably also change the name (to nuxt-compression) as nuxt3-modules org is now part of the nuxt-modules/nuxt-community.

@Baroshem Baroshem self-assigned this Oct 9, 2022
@BenjaminOddou
Copy link
Author

I am closing the issue as this module will not support nuxt 3 as described here

@BenjaminOddou BenjaminOddou closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2022
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

2 participants