davestewart / nuxt-content-assets

Enable locally-located assets in Nuxt Content

Home Page:https://npmjs.com/package/nuxt-content-assets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nitro Build gets stuck at "You can preview this build using node .output/server/index.mjs" and doesn't complete when using nuxt-content-assets

brunopbarbosa opened this issue · comments

Background

Using this module to serve relative images with nuxt content, runs as expected while in dev.

Issue

When running npm run build (both on server or local) with the module enabled on the nuxt.config file, the build goes all the way through until this point and then just hangs indefinitely.

removing this module from the module list in the config file seems to let the build run as normal.

Any insight would be highly appreciated!

Hello,

Sorry to leave you hanging! (EDIT: literally 😆)

What version of Nuxt are you running (run the code below to find out) ?

echo -e "\nNode `node -v`\n" && npm list nuxt @nuxt/content nuxt-content-assets --depth=0

If > 3.6.5 it could be related to this:

Can you confirm?

See also the linked issue 169. Right now it seems a few modules are causing this, the cause is not yet known, but I suspect it's something to do with Nuxt > 3.7.0.

Run into this problem myself under windows.
Fixing the nuxt version to 3.6.5 fixed it, it does appear to be a 3.7 issue

Hi, yes, i downgraded to 3.6.5 and it does in fact solve it!

I'll be keeping an eye out on those other issues you mentioned, at the moment fixing on 3.6.5 is not problematic.

And thanks again for your help! I didn't have to hang for too long 😆

I'll leave the issue open in case someone else ends up here, but feel free to close it if you think it's more appropriate!

Whoop!

Yes, let's leave it open until it – hopefully – gets solved upstream.

Thanks for reporting back!

This issue is now being tracked in the Nuxt CLI repo:

I think I've found a temporary workaround that allows us to use the latest version of nuxt with this module
Based on these links

I tried adding the following to the nuxt config

export default defineNuxtConfig({
  hooks: {
    close: (nuxt) => {
      if (!nuxt.options._prepare)
        process.exit()
    }
  }
})

Then I run nuxi generate and it all seems to work / finish under nuxt 3.8.1
not ideal but at least I think we can use the latest nuxt until there's a better fix

@Hecatron that resolves the issue but is there any downside using it?

I don't think so but I can't be 100% certain, for now it's a sort of temporary fix until nuxt sort they're end out, since I think it's not the only module it affects