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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt dev results in error "Invalid host defined options" #266

Closed
tobiasdiez opened this issue Oct 12, 2021 · 2 comments
Closed

Nuxt dev results in error "Invalid host defined options" #266

tobiasdiez opened this issue Oct 12, 2021 · 2 comments
Labels
bridge bug Something isn't working

Comments

@tobiasdiez
Copy link
Contributor

tobiasdiez commented Oct 12, 2021

Environment

  • Operating System: Windows_NT
  • Node Version: v16.10.0
  • Nuxt Version: 2.16.0-27226092.034b9901
  • Package Manager: Yarn
  • Bundler: Webpack
  • User Config: target, ssr, head, css, plugins, components, buildModules, modules, serverMiddleware, watch, nitro, build, storybook, createRequire
  • Runtime Modules: -
  • Build Modules: @nuxtjs/tailwindcss@4.2.1, portal-vue/nuxt, @nuxt/postcss8@1.1.3, pinia/nuxt, @nuxt/bridge@3.0.0-27234211.2a0afbd

Describe the bug and expected behavior

After following the migration guide (for Nuxt 2 > Nuxt Bridge), nuxt dev and nuxt build fail with the following error while loading the @nuxt/bridge module:

 FATAL  Invalid host defined options                                                                                                                                                                                                                      18:43:00  

  at ModuleContainer.module.exports (node_modules\@nuxt\bridge\module.cjs:3:3)
  at ModuleContainer.addModule (node_modules\@nuxt\core-edge\dist\core.js:175:34)
  at node_modules\@nuxt\utils-edge\dist\utils.js:497:61
  at async ModuleContainer.ready (node_modules\@nuxt\core-edge\dist\core.js:45:7)
  at async Nuxt._init (node_modules\@nuxt\core-edge\dist\core.js:348:5)


   ╭─────────────────────────────────────────────╮
   │                                             │
   │   ✖ Nuxt Fatal Error                        │
   │                                             │
   │   TypeError: Invalid host defined options   │
   │                                             │
   ╰─────────────────────────────────────────────╯

The code in question is the following
https://github.com/nuxt/framework/blob/da7ff44c93f82e65c562a5470a272f032b1dad13/packages/bridge/module.cjs#L1-L4

After a bit of googling, the error usually occurs in the context of esm modules and webpack. But that's all I could find.

Steps to reproduce

Steps to reproduce the behavior:

  1. Follow migration guide.
  2. Run nuxt dev.

Live example: JabRef/JabRefOnline#480

Additional context

The link to the nuxt bridge sandbox is invalid, thus I could not try to replicate the error there (but to be honest, I also wouldn't be able to guess where to start).

@tobiasdiez tobiasdiez added bridge bug Something isn't working labels Oct 12, 2021
@pi0
Copy link
Member

pi0 commented Oct 12, 2021

Hi @tobiasdiez. Checking your repo, it seems is because of v8-compile-cache issue with esm. Using DISABLE_V8_COMPILE_CACHE=true yarn build solves the first issue but if you remove yarn.lock and recreate it, a workaround won't be also needed and yarn build works!

Checking more, it seems you are depending on @nuxtjs/composition-api which is not supported (some utils are kept for compat). Feel free to ping us in your PR or create new issue if having other problems for migration and good luck ❤️

@pi0 pi0 closed this as completed Oct 12, 2021
@tobiasdiez
Copy link
Contributor Author

@pi0 Thanks a lot for the quick answer. Deleting and regenerating the lock file indeed fixed the problem.

I encountered a few other problems, which I will add in the linked PR above and ping you (thanks for the offer!).

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

No branches or pull requests

2 participants