Stencil: 1.12.3 "Composite projects may not disable declaration emit."

Created on 8 Apr 2020  Â·  8Comments  Â·  Source: ionic-team/stencil

Stencil version:

 @stencil/[email protected]

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

triage

Most helpful comment

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.

All 8 comments

Still happening with 1.12.6

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?

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

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

Result:
image

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:

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.

Fixed!

Was this page helpful?
0 / 5 - 0 ratings