Stencil: Build fails, (0 , workspace_1.readJsonFile) is not a function
See original GitHub issueDescribe the bug I can not build a Stencil library immediately after creating it. It fails with the following error:
> nx run web-components:build --verbose
(0 , workspace_1.readJsonFile) is not a function
TypeError: (0 , workspace_1.readJsonFile) is not a function
at copyOrCreatePackageJson (C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\@nxext+stencil@13.1.0_c85b6e2e4017c9570146ef9fc4663e52\node_modules\@nxext\stencil\src\executors\stencil-runtime\prepare-config-and-outputarget-paths.js:27:58)
at prepareDistDirAndPkgJson (C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\@nxext+stencil@13.1.0_c85b6e2e4017c9570146ef9fc4663e52\node_modules\@nxext\stencil\src\executors\stencil-runtime\prepare-config-and-outputarget-paths.js:63:5)
at C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\@nxext+stencil@13.1.0_c85b6e2e4017c9570146ef9fc4663e52\node_modules\@nxext\stencil\src\executors\stencil-runtime\prepare-config-and-outputarget-paths.js:67:9
at Generator.next (<anonymous>)
at C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\tslib@2.3.1\node_modules\tslib\tslib.js:117:75
at new Promise (<anonymous>)
at __awaiter (C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\tslib@2.3.1\node_modules\tslib\tslib.js:113:16)
at prepareConfigAndOutputargetPaths (C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\@nxext+stencil@13.1.0_c85b6e2e4017c9570146ef9fc4663e52\node_modules\@nxext\stencil\src\executors\stencil-runtime\prepare-config-and-outputarget-paths.js:66:34)
at C:\Users\eglove\Projects\ethan-gone\node_modules\.pnpm\@nxext+stencil@13.1.0_c85b6e2e4017c9570146ef9fc4663e52\node_modules\@nxext\stencil\src\executors\build\executor.js:37:92
at Generator.next (<anonymous>)
βββββββββββββββββββββββββββββββββββββββββββββββ
> NX ERROR Running target "web-components:build" failed
Failed tasks:
- web-components:build
To Reproduce
nx g @nxext/stencil:library web-components
nx g @nxext/stencil:make-lib-buildable --importPath='@companyName/web-components' web-components
Expected behavior
Build files are generated in dist/packages/web-components of Nx repo.
Additional context
@nrwl versions: 13.4.1 @nxext/stencil: 13.1.0 @stencil/core: 2.12.0
This is on a fresh build, no changes to default configs.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Error when building Stencil app that uses Stencil lib ... - GitHub
I have done a little debugging inside the index.js of the compiler. I think what is being returned from prerender.stenciljs.com (?) is faulty:....
Read more >Stencil: Sudden build error without message after adding ...
The exact problem here is, that the stencil-compiler seems to assume that the elements parameter is of type Element that is imported fromΒ ......
Read more >Vue - Stencil.js
Stencil can generate Vue component wrappers for your web components. This allows your Stencil components to be used within a Vue 3 application....
Read more >The Basics of Unit Testing in StencilJS - Elite Ionic
In this tutorial, we investigate how to use Jest to create unit tests for our StencilJS components.
Read more >Creating Web Components with Stencil - Auth0
A practical tutorial showing how to create Web Components using Stencil.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@DominikPieper I moved @nrwl/workspace back to 13.3.12 to get past this issue. However, there still seems to be a misconfiguration between Rollup and TypeScript when running the build on the dev server.
I tried using @rollup/plugin-typescript and adding this to stencil.config.ts
No luck. Is there another workaround for this?
EDIT: Removing the extension of the NX base tsconfig worked. Iβm not sure what the cause here is. But here is a diff for reference.
https://imgur.com/a/J2gCUej
@DominikPieper no worries. for now downgraded workspace package only. enjoy ur xmas holidays π