Stencil: build doesn't work on nx 15.9.x
Describe the bug
@nxext/stencil:build does not work after update to nx 15.9.x. Error message is shown:
Cannot find module '@nrwl/workspace/src/utilities/ast-utils'
To Reproduce Try to build project with latest nx
Expected behavior Executor should work as before.
Additional context Looks like this file: https://github.com/nxext/nx-extensions/blob/main/packages/stencil/src/utils/ast-utils.ts#L4 is importing file that does not exist anymore. It was moved: https://github.com/nrwl/nx/pull/15540/files#diff-6a3ae3fda9f50d1b43708469ef9af795224222b10b7b4802b561da5529d6db12
I have same problem! :/
I get the same thing. Brand new (package-based) NX repo. And the first thing I'm trying to do is add a stencil library and I get this error! I'm running @nxext/stencil:lib
same issue here
Today I have upgraded nx and I am facing the same issue.
@marcincichocki what version were these commands working with?
@MrGrigri Sorry I forgot to mention this in my post. This is an output of yarn info nx @nxext/stencil. It's working just fine with these versions.
Toggle
yarn info nx @nxext/stencil
├─ @nxext/stencil@npm:15.7.0
│ ├─ Instances: 1
│ ├─ Version: 15.7.0
│ │
│ └─ Dependencies
│ ├─ @nrwl/devkit@npm:~15.7.0 → npm:15.7.2
│ └─ ignore@npm:^5.2.0 → npm:5.2.0
│
└─ nx@npm:15.8.5
├─ Instances: 1
├─ Version: 15.8.5
│
├─ Exported Binaries
│ └─ nx
│
└─ Dependencies
├─ @nrwl/cli@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-darwin-arm64@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-darwin-x64@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-linux-arm-gnueabihf@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-linux-arm64-gnu@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-linux-arm64-musl@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-linux-x64-gnu@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-linux-x64-musl@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-win32-arm64-msvc@npm:15.8.5 → npm:15.8.5
├─ @nrwl/nx-win32-x64-msvc@npm:15.8.5 → npm:15.8.5
├─ @nrwl/tao@npm:15.8.5 → npm:15.8.5
├─ @parcel/watcher@npm:2.0.4 → npm:2.0.4
├─ @yarnpkg/lockfile@npm:^1.1.0 → npm:1.1.0
├─ @yarnpkg/parsers@npm:^3.0.0-rc.18 → npm:3.0.0-rc.20
├─ @zkochan/js-yaml@npm:0.0.6 → npm:0.0.6
├─ axios@npm:^1.0.0 → npm:1.3.3
├─ chalk@npm:^4.1.0 → npm:4.1.2
├─ cli-cursor@npm:3.1.0 → npm:3.1.0
├─ cli-spinners@npm:2.6.1 → npm:2.6.1
├─ cliui@npm:^7.0.2 → npm:7.0.4
├─ dotenv@npm:~10.0.0 → npm:10.0.0
├─ enquirer@npm:~2.3.6 → npm:2.3.6
├─ fast-glob@npm:3.2.7 → npm:3.2.7
├─ figures@npm:3.2.0 → npm:3.2.0
├─ flat@npm:^5.0.2 → npm:5.0.2
├─ fs-extra@npm:^11.1.0 → npm:11.1.0
├─ glob@npm:7.1.4 → npm:7.1.4
├─ ignore@npm:^5.0.4 → npm:5.2.0
├─ js-yaml@npm:4.1.0 → npm:4.1.0
├─ jsonc-parser@npm:3.2.0 → npm:3.2.0
├─ lines-and-columns@npm:~2.0.3 → npm:2.0.3
├─ minimatch@npm:3.0.5 → npm:3.0.5
├─ npm-run-path@npm:^4.0.1 → npm:4.0.1
├─ open@npm:^8.4.0 → npm:8.4.1
├─ semver@npm:7.3.4 → npm:7.3.4
├─ string-width@npm:^4.2.3 → npm:4.2.3
├─ strong-log-transformer@npm:^2.1.0 → npm:2.1.0
├─ tar-stream@npm:~2.2.0 → npm:2.2.0
├─ tmp@npm:~0.2.1 → npm:0.2.1
├─ tsconfig-paths@npm:^4.1.2 → npm:4.1.2
├─ tslib@npm:^2.3.0 → npm:2.5.0
├─ v8-compile-cache@npm:2.3.0 → npm:2.3.0
├─ yargs-parser@npm:21.1.1 → npm:21.1.1
└─ yargs@npm:^17.6.2 → npm:17.6.2
@marcincichocki Nx changed something internally. The 15.7 nxext package support Nx 15.7. I hadn’t time to update everything that changed
I can confirm the issue and as a workaround, downgrading to Nx 15.7.2 works.
Also, to work with the latest @stencil/core v3, I need to override the dependency of @nxext/stencil in the packages.json. Same if you are trying to integrate the latest Storybook v7 in your component library.
Yeah, it's still not working for me with [email protected] and @nxext/[email protected]. I still get Cannot find module '@nrwl/workspace/src/utilities/ast-utils' when trying to use @nxext/stencil:lib
@dgonzalezr storybook v7 works only with nrwl 15.9.x no?
Workaround for this problem is to install Stencil directly without using the @nxext/stencil extension and to create components, use the Stencil CLI.
Workaround for this problem is to install Stencil directly without using the @nxext/stencil extension and to create components, use the Stencil CLI.
Hi! @oscarcornejo do you happen to have a working example using only the Stencil CLI?
I worked around this by changing one line in @nxext/stencil 15.7.0 using a Yarn patch. I'm using NX 15.9.2. I have been using both without issues since.
I changed line 8 of @nxext/stencil/src/utils/ast-utils.js from
const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
to
const ast_utils_1 = require("@nrwl/workspace/src/utils/ast-utils");
Just recently tried nx and I got this issue too. And it took me a while to find out the bug being reported here. Instead of workaround shouldn't there be a good fix? Not a good experience for the first timer using Nx
same issue here
looking forward to the patch. Considering using Stencil CLI as @oscarcornejo suggests.
I worked around this by changing one line in @nxext/stencil 15.7.0 using a Yarn patch. I'm using NX 15.9.2. I have been using both without issues since.
I changed line 8 of
@nxext/stencil/src/utils/ast-utils.jsfromconst ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");to
const ast_utils_1 = require("@nrwl/workspace/src/utils/ast-utils");
How do you use that patch? It is possible also if I have been using pnpm instead of yarn?
How do you use that patch? It is possible also if I have been using pnpm instead of yarn?
@erichstark I used yarn patch: https://yarnpkg.com/cli/patch
Not familiar with pnpm, but there seems to be something similar: https://pnpm.io/cli/patch