question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

building stencil library not possible - dist folder not generated

See original GitHub issue

Hi there,

this might not been an issue per se, more a question. I’m not able to build my nx stencil library to create a dist folder.

Here are the steps I took:

  1. create a fresh nx 11 workspace npx create-nx-workspace@latest my-workspace with a new Angular app
  2. installing nxext npm install -D @nxext/stencil
  3. generating a stencil library via nx g @nxext/stencil:lib web-components
  4. making stencil lib buildable nx generate @nxext/stencil:make-lib-buildable web-components
  5. added output target for angular nx g @nxext/stencil:add-outputtarget web-components
  6. added WebComponentsAngularModule from @my-workspace/web-components-angular to app.module.ts

If I now run nx build my-app I receive an error Error: libs/web-components-angular/src/lib/web-components-angular.module.ts:3:38 - error TS2307: Cannot find module '@my-workspace/web-components/loader' or its corresponding type declarations.

At a closer look there is no dist folder at /libs/web-components So I called nx run web-components:build

[56:10.7]  build, web-components, prod mode, started ...
[56:10.7]  transpile started ...
[56:10.8]  transpile finished in 104 ms
[56:10.8]  generating angular-library started ...
[56:10.9]  generate angular-library finished in 6 ms
[56:10.9]  build finished in 132 ms

but there is still no dist folder created.

How can I build my stencil library properly?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DominikPiepercommented, Jan 7, 2021

Hey, I took a look and prepared a PR for that repo with the fix. Basically the make-buildable builder had the bug, that the loader wasn’t added to the tsconfig. With that, nx wasn’t able to find the loader workspace imports for the angular-module.

1reaction
DominikPiepercommented, Jan 4, 2021

Maybe some clarification about what’s going ideally on.

The dist of web-components contain after build the web components. That’s where the loader folder should appear as well. The web-components-angular contains glue-code for the web-components and Angular. They’re both needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

The is no `loader` folder inside the `dist` folder. Can NOT use ...
Expected behavior: I would expect the loader folder to be inside the dist folder, so I could use Stencil web components inside an...
Read more >
Distributing Web Components Built with Stencil
The dist type is to generate the component(s) as a reusable library that can be ... It's recommended that this directory not be...
Read more >
What is the purpose of created folders in dist - Stack Overflow
I am working with web components using stenciljs . Its great library for creating web components that can we re-use anywhere.
Read more >
Getting Started with Monorepo with Nx Nrwl - Rupesh Tiwari
This will solve the problem and you will not have many Git ... Notice the app is building and the dist folder is...
Read more >
An Introduction into Stencil.js - Gabriel Tanner
The main goal of this article is to give a quick overview of the Stencil framework and how to use it to build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found