Skip to content

bug: NuxtImage not installed by module #26

@kheiner

Description

@kheiner

Testing a minimal reproduction for another issue & uncovered:

Image

Steps to reproduce:

  1. Install Nuxt npm create nuxt@latest without adding any optional features.
  2. Install nuxt-directus-sdk npm install nuxt-directus-sdk add it to modules in nuxt.config.ts
  3. npm run dev

It looks like the installModule() was removed from module.ts in this commit. Current next branch code should have it re-added on the conditional - I think that's the source of the problem and is a simple fix.

// Register @nuxt/image with Directus provider
const imageConfig = typeof options.image === 'boolean' ? { enabled: options.image } : options.image
const imageEnabled = imageConfig?.enabled ?? true
if (imageEnabled) {
const { setDefaultProvider, modifiers } = imageConfig || {}
const imageBaseUrl = devProxyEnabled
? `${devProxyPath}/assets`
: useUrl(clientUrl, 'assets')
await registerModule('@nuxt/image', 'image', {
// Set default provider if requested
...(setDefaultProvider && { provider: 'directus' }),
// Configure Directus provider
directus: {
baseURL: imageBaseUrl,
modifiers,
},
})
}

Happy to fix but before I do, I want to make sure I'm not taking down Chesterton's Fence. Why was it switched?

Originally posted by @kheiner in #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions