nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

The setup binding property "..." is already declared - New Nuxt project #355

Closed nehuenpereyra closed 2 years ago

nehuenpereyra commented 2 years ago

Environment

Operating System: Linux Node Version: v16.15.0 Nuxt Version: v2.15.8 Package Manager: npm@8.5.5 Builder: webpack - v4.46.0 Modules: core-js@3.19.3, vue@2.6.14, vue-server-renderer@2.6.14, vue-template-compiler@2.6.14, @nuxt/bridge@3.0.0-27545203.75e046f

Reproduction

  1. Create Nuxt project npm init nuxt-app template

nuxt project

  1. Configure how the guide: https://v3.nuxtjs.org/bridge/overview/

  2. Configure the Nuxt.config file:

bridge: {
    vite: false,
    nitro: false
  }
  1. Create Counter component
    
    <template>
    <div>
    <h1>Index page</h1>
    <button @click="increment">
      Counter is: {{ state.count }}
    </button>
    </div>
    </template>

### Describe the bug

When updating the page the following warnings by console appear:

![warn ](https://lh3.googleusercontent.com/43kRFM9IijP01JNGJz-3mH_4SEnox9Fiztw0-J2CGG8bLmSRu9vaHJwOa0TnLt4yOFBpNJCvQZDLIocJojRl=w1326-h638-rw)

It can be noted that it comes from the Nuxt SSR.

### Additional context

When configuring the nuxt.config file:
```javascript
bridge: {
     …
     ssr: false
}

Warning disappear.

Logs

[Vue warn]: The setup binding property "state" is already declared.
[Vue warn]: The setup binding property "increment" is already declared.
antlionguard commented 2 years ago

@Luferov i think when ssr is closed there's context-sharing problem appears. #347 is solves this issue? or this solves only ssr is set true?

nehuenpereyra commented 2 years ago

It is solved when the ssr is set false.

antlionguard commented 2 years ago

It is solved when the ssr is set false.

oh my bad. in that case #347 solves this issue i think.

nehuenpereyra commented 2 years ago

I tried with #347 and the bug persists.

Luferov commented 2 years ago

I tried with #347 and the bug persists.

Thank you for your feedback. I’ll try to fix this bug.

danielroe commented 2 years ago

I cannot reproduce this: https://stackblitz.com/edit/github-8l1edb. If you're still experiencing it, would you create a reproduction please? 🙏