-
-
Notifications
You must be signed in to change notification settings - Fork 832
Closed
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within StencilHelp Wanted
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.22
Current Behavior
Inside a component we have this code:
// ...
// omitted useless code
// ...
export interface ConfirmationService {
confirm(): void;
}
@Component({
tag: 'my-component',
shadow: true,
})
export class MyComponent{
// ...
// omitted useless code
// ...Everything is compiling and working correctly.
This works only with interface, exporting Classes or Functions throws an error.
Is this fine and we can do that, or it may lead to unexpected behaviour and problems with the bundling as documented?
Expected Behavior
As documented here https://stenciljs.com/docs/module-bundling#one-component-per-module I would expect the compiler to throw something like:
[ ERROR ] src/components/my-component.tsx:4:1
To allow efficient bundling, modules using @Component() can only have a single export which is the component
class itself. Any other exports should be moved to a separate file. For further information check out:
https://stenciljs.com/docs/module-bundling
L4: export interface ConfirmationService()
System Info
No response
Steps to Reproduce
Export an interface from a component entry point.
Code Reproduction URL
none
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within StencilHelp Wanted