single-spa / single-spa-angular

Helpers for building single-spa applications which use Angular
Apache License 2.0
203 stars 78 forks source link

Running Index.html from dist folder, import error #392

Closed daddyschmack closed 2 years ago

daddyschmack commented 3 years ago

HI Guys,

This might totally be a user error, but I think it's more a matter of the build process missing something.

zone.min.js:28 Unhandled Promise rejection: Unable to resolve bare specifier '@wm-ocs/root-config' from http://localhost:63342/OCS-APPSHELL-MFE-UI/dist/

We are able to run our app using the default npm start comd. (run local environment from index.ejs) but if we npm build, it puts everything in the dist folder, but gives us the error about not being able to resolve the

as it's missing a parent URL. I've tried downloading 2 other example apps (https://github.com/angular-microfrontends/root-config), builiding, and then trying to run from awebserver, but always receive the same error: Unable to resolve bare specifier '@wm-ocs/root-config'

and it looks like this in my debugger.. Do I have to include some other import statement? Why wouldn't a build just work on a server.. I've searched for this error and see some answer,s but they don't seem to apply since this doesn't even work on your example app.. and I can't seem to find a step by step how to run this build on your otherwise exhaustive website. :-)

image

and the error points to here: https://github.com/systemjs/systemjs/blob/main/docs/errors.md#8

What parentUrl do I need to pass, or what do I need to import hat isn't included by the build process?

Again, I'm really sorry if this is a silly question..

John

daddyschmack commented 3 years ago

Okay, If anyone else comes looking, this article seems to answer the question that started this question. How to host on S-3.. I've pushed this task to my Ci/CD guy. https://hackernoon.com/how-to-develop-and-deploy-micro-frontends-using-single-spa-framework-0a2l3u6w But to the developers of single-spa, I think it would really be great if you could make this deployment process turnkey to run on any http server, much like Angular does... I think it's quite confusing to have to change some import parameters if there is already a build process going on.

joeldenning commented 3 years ago

Unable to resolve bare specifier '@wm-ocs/root-config'

This error is documented in https://github.com/systemjs/systemjs/blob/main/docs/errors.md#unable-to-resolve-bare-specifier

The single-spa-angular project doesn't have any active maintainers, but I review pull requests for it. I didn't read this issue fully but it seems just to be an issue with your import map.

filoxo commented 2 years ago

Closing due to inactivity.