nxext / nx-extensions

Nx Extension for StencilJs, SvelteJS, SolidJS, Ionic and VueJs
MIT License
451 stars 100 forks source link

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

Open thure opened 2 months ago

thure commented 2 months ago

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?

francescocaveglia commented 2 months ago

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

dgonzalezr commented 1 month ago

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!