Skip to content

1.12.3 "Composite projects may not disable declaration emit." #2349

Closed

Description

@bitflower

Stencil version:

I'm submitting a:

[x bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:
In dev mode the latest version 1.12.3 throws this error again in a lerna context although was fixed some time ago. It's back :-) All tsconfigfiles a re set to declaration: true.

Expected behavior:
Respects tsconfig with declaration: true and doesn't throw error.

Steps to reproduce:
Clone and run that repo: https://github.com/bitflower/stencil-lerna

image
image

Activity

  1. bitflower commented on Apr 28, 2020

    @bitflower
    ContributorAuthor

    Still happening with 1.12.6

  2. bitflower commented on Apr 29, 2020

    @bitflower
    ContributorAuthor

    Further analysis shows that there is a difference between prod and dev build on this line:
    image

    On prod build this returns:

    []
    

    whereas in dev mode it returns:

    [ { file: undefined,
        start: undefined,
        length: undefined,
        messageText: 'Composite projects may not disable declaration emit.',
        category: 1,
        code: 6304,
        reportsUnnecessary: undefined } ]
    

    Somehow in dev mode the tsconfig seems to be different.

    @manucorporat / @adamdbradley is the tsconfig somehow manipulated in dev mode?

  3. bitflower commented on Apr 29, 2020

    @bitflower
    ContributorAuthor

    The loaded config is exactly the same so it must be changed somehow during transpile:
    stencil-ts-config

  4. bitflower commented on Apr 29, 2020

    @bitflower
    ContributorAuthor

    I got it working with the help of @simonhaenisch by changing this line:
    image

    Result:
    image

  5. bitflower commented on May 6, 2020

    @bitflower
    ContributorAuthor

    Conversation from Slack for reference:

    simonhaenisch(wird in einem neuem Tab geöffnet) vor 6 Tagen
    @matthias Max not sure but wouldn't it just fix it if you explicitly set buildDist: true in your stencil config?

    simonhaenisch(wird in einem neuem Tab geöffnet) vor 6 Tagen
    it's an actual option for stencil.config.ts
    image.png
    image.png
    (wird in einem neuem Tab geöffnet)

    Matthias Max(wird in einem neuem Tab geöffnet) vor 5 Tagen
    Agreed this is maybe one way. But I would have expected the typescript setup to be the same for dev and prod without having to adjust the config. Especially if the error doesn‘t lead you at all to the right place. Do you agree?

    So would this be more of a warning that should be printed instead of the „fix“ I PR‘ed? @adam what do you think?

    Matthias Max(wird in einem neuem Tab geöffnet) vor 5 Tagen
    Like, this took me ages to find and I want others to not have to fall into this trap.

    adam(wird in einem neuem Tab geöffnet) vor 5 Tagen
    sorry pretty disconnected right now, can you ping me again on Monday? We’ll be able to dedicate a lot more time next week

    Matthias Max(wird in einem neuem Tab geöffnet) vor 5 Tagen
    Awesome, cu :victory:

  6. simonhaenisch commented on May 6, 2020

    @simonhaenisch
    Contributor

    TBH I don't really get the buildDist option of the config... maybe it should be removed, and its logic be replaced with outputTargets.some(target => target.type === 'dist')? Is it a legacy option from before output targets were a thing? If so, I'd definitely get rid of it, or at least deprecate it and change the implementation so that it doesn't create different behavior anymore.

  7. manucorporat commented on May 6, 2020

    @manucorporat
    Contributor

    Fixed!

  8. ipepiji commented on Mar 29, 2023

    @ipepiji

    I still get "Error: error TS6304: Composite projects may not disable declaration emit."

  9. simonhaenisch commented on Mar 29, 2023

    @simonhaenisch
    Contributor

    Then you should probably open a new issue instead of commenting on this one that was fixed 3 years ago which means this time it's probably only tangentially related to the cause of the issue back then? You can mention this issue in your new one for reference, and your new issue will actually get looked at by the current maintainers.

    I've unsubscribed from this issue now but please be aware that when you comment on an old issue, you notify everyone who's been active on it before.

  10. Yokohmariam commented on Jun 20, 2024

    @Yokohmariam

    inside tsconfig.base.json add

    "compilerOptions:{
        "declaration": true,
        "composite": true,
        "emitDeclarationOnly": true,
    }
    

    inside tsconfig.storybook.json add

    "compilerOptions":{
      "compilerOptions": {
        "emitDecoratorMetadata": true,
        "composite": true,
        "declaration": true,
        "declarationMap": true,
    
      },
      }
    
  11. oshliaer commented on Jun 27, 2024

    @oshliaer

    @Yokohmariam, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions