Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

useNuxt().options.runtimeConfig.public.pwaManifest is undefined #64

Closed
HigherOrderLogic opened this issue Nov 16, 2022 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@HigherOrderLogic
Copy link

When I run nuxi dev/generate/build, I always encounter this error.

 ERROR  Cannot set properties of undefined (setting 'pwaManifest')                                                                                                                                   21:50:41  

  at manifest (/node_modules/@kevinmarrec/nuxt-pwa/dist/module.mjs:160:49)
  at setup (/node_modules/@kevinmarrec/nuxt-pwa/dist/module.mjs:379:13)
  at async normalizedModule (/node_modules/@nuxt/kit/dist/index.mjs:167:5)
  at async installModule (/node_modules/@nuxt/kit/dist/index.mjs:416:3)
  at async initNuxt (/node_modules/nuxt/dist/index.mjs:1827:7)
  at async loadNuxt (/node_modules/nuxt/dist/index.mjs:1859:5)
  at async loadNuxt (/node_modules/@nuxt/kit/dist/index.mjs:493:19)
  at async Object.invoke (/node_modules/nuxi/dist/chunks/build.mjs:34:18)
  at async _main (/node_modules/nuxi/dist/cli.mjs:50:20)

The code that throw error.

Code
const manifest = (pwa) => {
  if (!pwa.manifest)
    return;
  const nuxt = useNuxt();
  nuxt.options.runtimeConfig.public.pwaManifest = pwa.manifest;
  if (nuxt.options.ssr) {
    addServerHandler({
      route: "/manifest.json",
      handler: pwa._resolver.resolve("./runtime/server/manifest")
    });
  } else {
    addTemplate({
      filename: "manifest.json",
      getContents: () => JSON.stringify(pwa.manifest),
      dst: join(pwa._buildDir, "manifest.json"),
      write: true
    });
  }
  pwa._manifestMeta = {
    rel: "manifest",
    href: joinURL(nuxt.options.app.baseURL, "manifest.json")
  };
};

Ouput of nuxt info.

Details
  • Operating System: Windows_NT
  • Node Version: v18.12.1
  • Nuxt Version: 3.0.0-rc.14
  • Nitro Version: 1.0.0
  • Package Manager: yarn@3.3.0
  • Builder: vite
  • User Config: build, css, typescript, modules, colorMode, unocss, vueuse, vite
  • Runtime Modules: @kevinmarrec/nuxt-pwa@0.9.1, @nuxtjs/color-mode@3.1.8, @nuxtjs/critters@0.3.3, @unocss/nuxt@0.46.5, @vueuse/nuxt@9.5.0
  • Build Modules: -
@kevinmarrec kevinmarrec self-assigned this Nov 16, 2022
@kevinmarrec kevinmarrec added the bug Something isn't working label Nov 16, 2022
@kevinmarrec
Copy link
Owner

hi @HigherOrderLogic I thinks this is caused by some breaking changes the rc.14 has been bringing.

I'll work on a fix.

@HigherOrderLogic
Copy link
Author

hi @HigherOrderLogic I thinks this is caused by some breaking changes the rc.14 has been bringing.

I'll work on a fix.

Thanks for the quick response. V3 stable has just been released so maybe updating straight to V3 stable?

@kevinmarrec
Copy link
Owner

Sure thing :)

@HigherOrderLogic
Copy link
Author

Sure thing :)

I'll closed this issue since it's fixed on upstream at nuxt/framework#9050.

@kevinmarrec
Copy link
Owner

kevinmarrec commented Nov 16, 2022

@HigherOrderLogic Yep I algo got the confirmation internally with the framework team :)

🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants