serverless-webpack icon indicating copy to clipboard operation
serverless-webpack copied to clipboard

Transitive externals cause packaging to fail

Open ghost opened this issue 3 years ago • 2 comments

This is a bug report

Description

We mark some native node packages as externals because they cannot be bundled as webpack. However, if the package is transitively required by another package and not directly required as a dependency, yarn install --frozen-lockfile will fail and say that the lock file needs to be updated when the module is packaged.

Previously, we just added this directly to our dependencies, but as was noted in a depcheck issue, we probably shouldn't do this to verify that the version is correct, and that it's actually needed by the package.

Not really sure how to solve this.

Related:

  • depcheck/depcheck#566 (closed in favor of this)

ghost avatar Mar 16 '21 15:03 ghost

I've no idea how to fix it either. Maybe you can create a small and simple project so we'll be able to reproduce the bug?

j0k3r avatar Mar 17 '21 08:03 j0k3r

In this specific example we were using synchronized-promise which depends on deasync, a native module. Don't really have the time to set up a small example but maybe someone else might be able to help out.

ghost avatar Mar 17 '21 15:03 ghost