smapiot / piral

🚀 Framework for next generation web apps using micro frontends. ⭐️ Star to support our work!
https://piral.io
MIT License
1.68k stars 125 forks source link

Angular SharedModule problem #646

Closed prepfarm closed 10 months ago

prepfarm commented 10 months ago

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

Environment Details and Version

Piral 1.3.3

Description

import { SharedModule } from 'piral-ng/common'; fails as it says that it cannot find module, even tho it's shared module from app shell. Installing it separately in the pilet, results in errors that @types/react isn't installed. Even after instaling types, errors are shown.

Steps to Reproduce

  1. Initialize Angular pilet
  2. Add SharedModule inside of @NgModule

Expected behavior

To be able to use <extension-component>

Actual behavior

Throws errors on build/debug once it's imported.

FlorianRappl commented 10 months ago

Can you please show a MWE and have your steps to reproduce filled out properly?

For instance, "initialize Angular pilet" - what does that mean? Are you using the template? Also, keep in mind that the package is piral-ng-common, not piral-ng/common, which is the old / outdated shim.

prepfarm commented 10 months ago

Thanks for quick reply! I was able to get it working by using piral-ng-common and not piral-ng/common which I saw in many examples and also in the docs (see under For pilet authors)

FlorianRappl commented 10 months ago

Thanks for the info - yes the peer dependencies (look at top of the document) are mentioned, however, as you stated it should be more clear that

npm i piral-ng-common

is mostly needed (otherwise some version is installed which might fit your Angular version or not - in the latter case leading to problems).

FlorianRappl commented 10 months ago

Re-opened as documentation task.

FlorianRappl commented 10 months ago

Landed in develop.