opencomponents / oc

OpenComponents, serverless in the front-end world for painless micro-frontends delivery
https://opencomponents.github.io/
MIT License
1.43k stars 122 forks source link

OC publish fails on components with alias dependencies #1366

Closed ashmeet-kandhari closed 6 months ago

ashmeet-kandhari commented 6 months ago

Who is the bug affecting?

What is affected by this bug?

When does this occur?

Where on the platform does it happen?

How do we replicate the issue?

Expected behavior (i.e. solution)

What version of OC, Node.js and OS are you using?

Other Comments

ricardo-devis-agullo commented 6 months ago

Interesting. What's the use case for an alias? Is that a dependency you are using on the client or on the server?

ashmeet-kandhari commented 6 months ago

We are using in both client and server. We observed the failure only while publishing the components (it doesn't publish)

ricardo-devis-agullo commented 6 months ago

what's the use case of needing this, though?

ashmeet-kandhari commented 6 months ago

Ah sorry, On the server side we have components using different versions of same dependency.

And we cannot change the versions as different components are using different versions

On Tue, 7 May, 2024, 17:47 Ricardo Devis Agullo, @.***> wrote:

what's the use case of needing this, though?

— Reply to this email directly, view it on GitHub https://github.com/opencomponents/oc/issues/1366#issuecomment-2098886843, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI7OGHGI2OLNSIDG6VDGJQTZBEAQHAVCNFSM6AAAAABHLIQJBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYHA4DMOBUGM . You are receiving this because you authored the thread.Message ID: @.***>

ricardo-devis-agullo commented 6 months ago

Can you post exactly the error you get when publishing?

ashmeet-kandhari commented 6 months ago

Here is the error

oc package --useComponentDependencies /drone/src/github/test-component

exec_node: ====================================================
exec_node: INFO: Performing Node Run-Time and V8 Engine configuration
exec_node: INFO: Making Run-Time and Engine options ( 'max-http-header-size=131072' ) console safe...
'package' '--useComponentDependencies' '/drone/src/github/test-component'
exec_node: ====================================================

Packaging -> /drone/src/github/test-component/_package
Ensuring dependencies are loaded...
Trying to link missing modules: @internal/dependent-components-2@npm:@nternal/dependent-components@2.1.0, react-dom17@npm:react-dom@17.0.2, react17@npm:react@17.0.2

The missing dependencies will be linked to component dependenciesAn error happened when linking the dependency @internal/dependent-components-2@npm:@internal/dependent-components with error Error: ENOENT: no such file or directory, ensureSymlink '/drone/src/github/test-component/node_modules/@internal/dependent-components-2@npm:@internal/dependent-components'
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
ricardo-devis-agullo commented 6 months ago

oc package works for me when having this

"case-1.5.3": "npm:case@^1.5.3"

can you give me a repository where I can reproduce?

ashmeet-kandhari commented 6 months ago

Hi @ricardo-devis-agullo , I think this was an issue on our side (this was done long time ago so forgot) where the way our CI pipeline is setup we were not able to download the missing dependencies in this step Ensuring dependencies are loaded...

And when the issue was investigated we found that the component alias dependencies were not resolving due to the alias issue in the pr that I have raised.

Hope that answers your question

ricardo-devis-agullo commented 6 months ago

Yeah, that makes sense! I will close the issue then :)