nx-extensions icon indicating copy to clipboard operation
nx-extensions copied to clipboard

Stencil: `Cannot read properties of undefined (reading 'validateConfig')`

Open thure opened this issue 9 months ago • 2 comments

Describe the bug When trying to use nx build elements (the lib package name is ‘elements’ for this project), nx gives the error in the title. The task is configured like so:

    "build": {
      "command": "@nxext/stencil:build",
      "options": {
        "configPath": "packages/elements/stencil.config.ts",
        "outputPath": "packages/elements/dist"
      },
      "outputs": ["{options.outputPath}"]
    }

Unfortunately passing --verbose does not provide a stacktrace. This was after some other debugging that prompted populating configPath and outputPath (these error instead of being listed as required by the schema.json), so I can confirm Nx is running the executor provided in @nxext/stencil.

To Reproduce It will be difficult to provide a minimal reproduction because @nxext does not provide any functioning example project (that I could find), and I was unable to generate a functioning project using nx g @nxext/stencil:lib (#1087).

For me:

  1. Have an otherwise functioning nx workspace
  2. Install @nxext/stencil as a dev dependency
  3. Have an otherwise functioning Stencil project in the workspace
  4. Add a project.json with a build target configured as above.
  5. Observe issue

Expected behavior Should produce a build output without errors.

Additional context A proven, functioning project using these executors would help check my sanity. Is one available?

thure avatar May 01 '24 07:05 thure

Hi @thure , the issue seems related to @stencil/core version >= 4.17, installing version 4.16.0 works

francescocaveglia avatar May 08 '24 10:05 francescocaveglia

Hi there @DominikPieper 👋🏼, sorry to ping you directly but, when you have time, could you please take a look at the associated PR to solve this issue? This is blocking us from upgrading to the latest Stencil version. Thanks a ton!

dgonzalezr avatar May 14 '24 17:05 dgonzalezr