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

stub prototype and optionMergeStrategies for vue3 compat #40

Open
tobiasdiez opened this issue Nov 17, 2021 · 0 comments
Open

stub prototype and optionMergeStrategies for vue3 compat #40

tobiasdiez opened this issue Nov 17, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@tobiasdiez
Copy link
Contributor

Environment

  • Operating System: Linux
  • Node Version: v14.18.1
  • Nuxt Version: 2.16.0-27285136.ab1c6cb4
  • Package Manager: yarn@1.22.17
  • Bundler: Webpack
  • User Config: plugins, bridge, target, ssr, buildModules
  • Runtime Modules: -
  • Build Modules: @nuxt/bridge@3.0.0-27286006.a08b435

Reproduction

https://codesandbox.io/s/gracious-wildflower-g27zf

Describe the bug

The vueApp provided by nuxtApp in a plugin doesn't mock all vue properties, which make some libraries fail. I encountered so far prototype (with VueTailwind, as in the reproduction above) and config.optionMergeStrategies (with VueApollo).

Additional context

--- a/node_modules/@nuxt/bridge/dist/runtime/app.plugin.mjs
+++ b/node_modules/@nuxt/bridge/dist/runtime/app.plugin.mjs
@@ -23,7 +23,8 @@ export default (ctx, inject) => {
     vueApp: {
       component: Vue.component.bind(Vue),
       config: {
-        globalProperties: {}
+        globalProperties: {},
+        optionMergeStrategies: Vue.config.optionMergeStrategies
       },
       directive: Vue.directive.bind(Vue),
       mixin: Vue.mixin.bind(Vue),
@@ -33,7 +34,8 @@ export default (ctx, inject) => {
       use (vuePlugin) {
         vuePlugin.install(this)
       },
-      version: Vue.version
+      version: Vue.version,
+      prototype: {}
     },
     provide: inject,
     globalName: 'nuxt',

fixed it for me.

Logs

No response

@danielroe danielroe added bug Something isn't working and removed pending triage labels Nov 17, 2021
@pi0 pi0 added enhancement New feature or request and removed bug Something isn't working labels Nov 17, 2021
@pi0 pi0 changed the title Missing stubs in vueApp stub prototype and optionMergeStrategies for vue3 compat Nov 17, 2021
@danielroe danielroe transferred this issue from nuxt/framework Apr 13, 2022
@danielroe danielroe removed the bridge label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants