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

fix: conflict with @nuxtjs/pwa #307

Closed
danielroe opened this issue Nov 25, 2020 · 4 comments
Closed

fix: conflict with @nuxtjs/pwa #307

danielroe opened this issue Nov 25, 2020 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@danielroe
Copy link
Member

danielroe commented Nov 25, 2020

Using this module at the moment conflicts with @nuxtjs/pwa which expects to find a global head object rather than a head() function. At the moment the module will simply disable useMeta use within onGlobalSetup if @nuxtjs/pwa is detected.

@danielroe danielroe added the bug Something isn't working label Nov 25, 2020
@danielroe danielroe self-assigned this Nov 25, 2020
@danielroe danielroe changed the title fix: useMeta in global setup overrides Nuxt config head fix: conflict with @nuxtjs/pwa Nov 25, 2020
@danielroe danielroe reopened this Nov 25, 2020
@danielroe danielroe added the help wanted Extra attention is needed label Nov 25, 2020
@1ed
Copy link

1ed commented Dec 2, 2020

Hello! I've run into this issue, but I don't really get what should I do to fix it?

WARN  useMeta is not supported in onGlobalSetup as @nuxtjs/pwa detected.                                                                                                                           08:29:24
See https://github.com/nuxt-community/composition-api/issues/307


 WARN  Module @nuxtjs/pwa not found. Please ensure @nuxtjs/pwa is in devDependencies and installed. HINT: During build step, for npm/yarn, NODE_ENV=production or --production should NOT be used.  08:29:24


 FATAL  Cannot find module '@nuxtjs/pwa'. Please verify that the package.json has a valid "main" entry                                                                                              08:29:24

  at new MAIN_NOT_FOUND (node_modules/esm/esm.js:1:217685)
  at zo (node_modules/esm/esm.js:1:223524)
  at $o (node_modules/esm/esm.js:1:224571)
  at xu (node_modules/esm/esm.js:1:226413)
  at wu (node_modules/esm/esm.js:1:227391)
  at Eu (node_modules/esm/esm.js:1:227999)
  at Module.<anonymous> (node_modules/esm/esm.js:1:295976)
  at Resolver.n [as _require] (node_modules/esm/esm.js:1:279589)
  at Resolver.requireModule (node_modules/@nuxt/core/dist/core.js:615:31)
  at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:180:38)


   ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                                           │
   │   ✖ Nuxt Fatal Error                                                                                      │
   │                                                                                                           │
   │   Error: Cannot find module '@nuxtjs/pwa'. Please verify that the package.json has a valid "main" entry   │
   │                                                                                                           │
   ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯

The only option is to remove @nuxtjs/pwa? What about patching the pwa package to be compatible? Sorry, I'm quite new to nuxt and javascript, could you give me some pointers here, please?

@danielroe
Copy link
Member Author

@1ed Could you share a reproduction? It almost like like you don't have @nuxtjs/pwa in your devdependencies. The warning you see is caused by the presence of the pwa module in your build modules, and the only feature that doesn't work is using useMeta within onGlobalSetup

@1ed
Copy link

1ed commented Dec 14, 2020

I've found what was wrong. I've used @nuxtjs/pwa's master branch and they changed the entry point by the typescript rewrite, but it is not committed into git, just for releases. Thanks!

@1shaked
Copy link

1shaked commented May 7, 2021

I have the same issue I am not running Nuxt with typescript; this has only happened when I have the composition-API plugin.
When would be a stable release?

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

No branches or pull requests

3 participants