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: results.fileNames undefined during compilation in stencil 2.17.3 in NX #3510

Closed
3 tasks done
orl99 opened this issue Aug 4, 2022 · 7 comments
Closed
3 tasks done
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@orl99
Copy link

orl99 commented Aug 4, 2022

Prerequisites

Stencil Version

2.17.3

Current Behavior

Currently, I we are having problems compiling one library that we recently created with a few components for a future DS that we plan to make, this is currently the CLI out when we run nx run aqua-elements:build

image

nx run aqua-elements:build


[ WARN  ]  exit 1

/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:41837
    results.fileNames = results.fileNames.filter((f) => {
                                ^

TypeError: Cannot read properties of undefined (reading 'fileNames')
    at Object.t.getParsedCommandLineOfConfigFile (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:41837:33)
    at pe (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:8913:2294592)
    at Object.e.createWatchProgram (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:8913:2287601)
    at createTsBuildProgram (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:63449:12)
    at /Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:63483:5
    at new Promise (<anonymous>)
    at createFullBuild (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:63459:10)
    at Object.build (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/compiler/stencil.js:64732:23)
    at taskBuild (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/cli/index.cjs:1671:40)
    at async runTask (/Users/qismbp12/Documents/GitHub/cbhz-nx/node_modules/@stencil/core/cli/index.cjs:2327:13)

image

It's important to mention that we use NX as monorepo.

Any reasons why we are having this problem?
Is anyone also having the same problem?

Expected Behavior

Have a successful compilation process

Steps to Reproduce

1- npm i
2- nx run aqua-elements:build

Code Reproduction URL

N/A

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 4, 2022
@orl99 orl99 changed the title bug: bug: results.fileNames undefined during compilation in stencil 2.17.3 in NX Aug 4, 2022
@rwaskiewicz
Copy link
Member

Hey @orl99 👋

The value stored in results there is determined by a call to a TypeScript compiler API, getParsedCommandLineOfConfigFiles. That code can be found here. Looking around that source, it appears as it this block might be the offending code that's returning undefined.

I think this could be related to attempting to resolve a TS configuration file, which may make sense if the file is in a monorepo.

I think that Stencil can handle this a little more gracefully, but in order to continue debugging this further, can you create a minimal reproduction case for us to investigate further?

@rwaskiewicz rwaskiewicz added the ionitron: needs reproduction This PR or Issue does not have a reproduction case URL label Aug 4, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Aug 4, 2022

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label Aug 4, 2022
@m4s7
Copy link

m4s7 commented Aug 5, 2022

Thanks for this thread, I have the same problem. I just want to link the related issue in the @nxext/stencil repo: nxext/nx-extensions#771

@m4s7
Copy link

m4s7 commented Aug 5, 2022

Steps to reproduce:

yarn create nx-workspace
  • Name: test-stencil
  • Type: app
  • nx-cloud: no
yarn add --dev @nxext/stencil
yarn nx generate @nxext/stencil:application sample --no-interactive
yarn nx run sample:build

-> Working build

yarn add --dev @stencil/[email protected]
yarn nx run sample:build

-> Failing Build

Repo: https://github.com/m4s7/failing-sample

@pranav-js
Copy link

only way to fix as of now is to pin stencil/core at 2.17.1 , as 2.17.2 onwards it starts giving this error

@rwaskiewicz
Copy link
Member

Thanks all, y'all are awesome! I've confirmed this is a bug, and relates to how the NX plugin calls Stencil's APIs. I've ID'ed the commit in the Stencil repo that causes this, and am going to have someone take a look at this early next week

@rwaskiewicz rwaskiewicz added Bug: Validated This PR or Issue is verified to be a bug within Stencil and removed ionitron: needs reproduction This PR or Issue does not have a reproduction case URL labels Aug 5, 2022
@rwaskiewicz
Copy link
Member

The PR that fixes this issue (#3518) is a part of today's v2.17.4 release. As a result, I'm going to close this issue. Should the issue reoccur on v2.17.4+ of Stencil, please open a new ticket, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

No branches or pull requests

4 participants