opencomponents/oc

OC publish fails on components with alias dependencies

Closed this issue · 9 comments

Who is the bug affecting?

  • The bug is affecting component creators, while publishing the components having dependency versions as npm aliases

What is affected by this bug?

  • Component publishing

When does this occur?

  • When the component dependencies has npm alias dependencies . For example
"dependencies": {
  "case-1.5.3": "npm:case@^1.5.3",
  "kool": "npm:case@^1.6.1"
}

Where on the platform does it happen?

How do we replicate the issue?

  • Have a component with npm alias dependency and try to publish

Expected behavior (i.e. solution)

  • Components to be published, irrespective of the type of dependency version.

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

  • v0.49.43+

Other Comments

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

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

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

Can you post exactly the error you get when publishing?

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 */);

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?

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

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