gloriasoft / veaury

Use React in Vue3 and Vue3 in React, And as perfect as possible!
MIT License
1.29k stars 82 forks source link

[Vue warn]: Invalid vnode type when creating vnode: undefined. #85

Open zhaozhongyu opened 1 year ago

zhaozhongyu commented 1 year ago

helloworld.vue内容

<script setup>
  import { onMounted } from 'vue';
    onMounted(() => {
        console.log('mounted');
    })

</script>

<template>
  <div>hello world</div>
</template>

react中引用:

import { applyVueInReact, applyPureVueInReact } from 'veaury';
import helloworld from './helloworld.vue';

const HelloWorld = applyVueInReact(helloworld);

// <HelloWorld></HelloWorld>

此时控制台提示 image

界面的元素: image

devilwjp commented 1 year ago

@zhaozhongyu 提供一个范例项目给我

Parag2385 commented 8 months ago

@zhaozhongyu Were you able to solve this issue?

glepka commented 4 months ago

I have the same issue image

@devilwjp how I can solve it?

@Parag2385 were you able to solve this problem?

Parag2385 commented 4 months ago

@glepka , nope, I couldn't figure out. I ended up not using veaury. Instead, I'm developing the vue app screen by screen and using routing to run it by the side of our react app.

devilwjp commented 4 months ago

@Parag2385 @glepka Can anyone provide an example project?

glepka commented 4 months ago

@Parag2385 @glepka Can anyone provide an example project?

what exactly needs to be sent?

devilwjp commented 4 months ago

@Parag2385 @glepka Can anyone provide an example project?

what exactly needs to be sent?

Provide the github URL of a test project. @glepka

glepka commented 4 months ago

@Parag2385 @glepka Can anyone provide an example project?

what exactly needs to be sent?

Provide the github URL of a test project. @glepka

I created a private repository and added you as a collaborator https://github.com/glepka/vueinreact

There is a simple structure The Vue component should appear on the "/test" route, but this does not happen

The vue component itself is located in the dist folder

devilwjp commented 4 months ago

@Parag2385 @glepka Can anyone provide an example project?

what exactly needs to be sent?

Provide the github URL of a test project. @glepka

I created a private repository and added you as a collaborator https://github.com/glepka/vueinreact

There is a simple structure The Vue component should appear on the "/test" route, but this does not happen

The vue component itself is located in the dist folder

@glepka So is this project built using create reat app? It looks like you don't have webpack.config.js configured, I think you may need to run npm run eject first. For details on how to configure webpack, please refer to https://github.com/gloriasoft/veaury/tree/master/dev-project-react/README.md

I think the problem you're having is that your project doesn't recognize the .vue file because you didn't add veaury/webpack/VeauryVuePlugin in webpack.config.js

devilwjp commented 4 months ago

@glepka Is the problem solved?