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

bug: Error about stenil! #1251

Open
1 of 12 tasks
ayangweb opened this issue Aug 4, 2023 · 0 comments
Open
1 of 12 tasks

bug: Error about stenil! #1251

ayangweb opened this issue Aug 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ayangweb
Copy link
Contributor

ayangweb commented Aug 4, 2023

I am interested in helping provide a fix!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Preact
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

Reproduction case

No link

Expected Behaviour

import { Component, h } from '@stencil/core'

@Component({
  tag: 'my-button',
})
export class MyButton {
  render() {
    return (
      <button>
        <slot />
      </button>
    )
  }
}
import { Component, h } from '@stencil/core'

@Component({
  tag: 'my-example',
})
export class MyExample {
  render() {
    return <my-button>example</my-button>
  }
}

Outputs component content normally when used directly!

image

Actual Behaviour

import { Component, h } from '@stencil/core'

@Component({
  tag: 'my-button',
})
export default class MyButton {
  render() {
    return (
      <button>
        <slot />
      </button>
    )
  }
}
import { Component, h } from '@stencil/core'

import MyButton from './button'

@Component({
  tag: 'my-example',
})
export default class MyExample {
  render() {
    return <MyButton>example</MyButton>
  }
}

stencil cannot export components using export default or the following error is reported!

image

stencil automatically registers the component, it doesn't need to be imported and can't be imported and used, it will report an error if it is imported and used!

image

Additional Information

Let's see what kind of way it needs to be handled? I can contribute code!

@ayangweb ayangweb added the bug Something isn't working label Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant