Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamiewarb/repro-define-component
Reproduction for a bug with Nuxt Bridge
https://github.com/jamiewarb/repro-define-component
Last synced: 10 days ago
JSON representation
Reproduction for a bug with Nuxt Bridge
- Host: GitHub
- URL: https://github.com/jamiewarb/repro-define-component
- Owner: Jamiewarb
- Created: 2021-12-20T16:02:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-20T16:14:04.000Z (about 3 years ago)
- Last Synced: 2024-11-07T03:46:57.719Z (about 2 months ago)
- Language: JavaScript
- Size: 230 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# define-component
This repo is a reproduction of a bug I'm getting with Nuxt Bridge.
This repo was created following these instructions:
1. Create a fresh Nuxt 2 project `yarn create nuxt-app define-component`
2. Upgrade to Nuxt Bridge following this guide: https://v3.nuxtjs.org/getting-started/bridge/
3. Add a Test.vue component to `~/components`
4. Add an input and a button, and give them `@change` and `@click.prevent` events respectively (or use `v-on:`)
5. The handler for these events doesn't matter, but I made them call a method on the component.## The Error
To get the error:
- Run `yarn dev` and open localhost:3000 in a browser.
- Observe the error "defineComponent is not defined".![image](https://user-images.githubusercontent.com/2754728/146798150-710ef71d-7cac-4937-ab68-3e60b20958dd.png)
To circumvent the error:
- Remove either the entire `` element or the entire `` element.
- Open localhost:3000 in a browser.
- Observe the error no longer displays.The docs say you can also import from `#imports` directly, but this gives another error:
- Add `import { defineComponent } from '#imports';` inside the `` tag
- Observe `Module parse failed: Identifier 'defineComponent' has already been declared (10:9)` error in terminal