Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build using yarn berry #8

Closed
theblockstalk opened this issue Jul 23, 2024 · 4 comments
Closed

Cannot build using yarn berry #8

theblockstalk opened this issue Jul 23, 2024 · 4 comments

Comments

@theblockstalk
Copy link

theblockstalk commented Jul 23, 2024

Building this package using yarn fails due to the github branch reference: "jsonld": "digitalcredentials/jsonld.js#v10.x",
https://github.com/digitalcredentials/jsonld.js

I first found this error when trying to build the https://veramo.io upstream packages that depend on this using the latest yarn (v4.3.1). In that installation, there is no control over the digitalcredentials/jsonld-signatures or digitalcredentials/jsonld packages.

Therefore this problem Is affecting all upstream repositories that use the latest version of yarn as a package manager.

Steps to reproduce

git clone [email protected]:digitalcredentials/jsonld-signatures.git
cd jsonld-signatures
corepack enable
# install latest yarn
yarn set version 4.3.1
yarn

Problem #1

dev@dev-VirtualBox:~/Documents/Git/ssi/jsonld-signatures$ yarn
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: jsonld@https://github.com/digitalcredentials/jsonld.js.git#commit=afa0062460b987bd42887b3a294cf0e0a0e5bde7: Packing the package failed (exit code 1, logs can be found here: /tmp/xfs-5d886d6c/pack.log)

pack.log

Packing jsonld@https://github.com/digitalcredentials/jsonld.js.git#commit=afa0062460b987bd42887b3a294cf0e0a0e5bde7 from sources
No package manager configuration detected; defaulting to Yarn

➤ YN0036: Calling the "prepack" lifecycle script
➤ YN0000: jsonld@workspace:. STDOUT 
➤ YN0000: jsonld@workspace:. STDOUT > [email protected] build
➤ YN0000: jsonld@workspace:. STDOUT > npm run build-webpack
➤ YN0000: jsonld@workspace:. STDOUT 
➤ YN0000: jsonld@workspace:. STDOUT 
➤ YN0000: jsonld@workspace:. STDOUT > [email protected] build-webpack
➤ YN0000: jsonld@workspace:. STDOUT > webpack
➤ YN0000: jsonld@workspace:. STDOUT 
➤ YN0000: jsonld@workspace:. STDOUT Hash: 0cc4e95202570e3f79f7c79e40343332f53863170cc4e95202570e3f79f7c79e40343332f5386317
➤ YN0000: jsonld@workspace:. STDOUT Version: webpack 4.47.0
➤ YN0000: jsonld@workspace:. STDOUT Child
➤ YN0000: jsonld@workspace:. STDOUT     Hash: 0cc4e95202570e3f79f7
➤ YN0000: jsonld@workspace:. STDOUT     Time: 362ms
➤ YN0000: jsonld@workspace:. STDOUT     Built at: 07/22/2024 8:04:53 PM
➤ YN0000: jsonld@workspace:. STDOUT         Asset      Size  Chunks             Chunk Names
➤ YN0000: jsonld@workspace:. STDOUT     jsonld.js  4.29 KiB  jsonld  [emitted]  jsonld
➤ YN0000: jsonld@workspace:. STDOUT     Entrypoint jsonld = jsonld.js
➤ YN0000: jsonld@workspace:. STDOUT     [0] multi ./lib/index.js 28 bytes {jsonld} [built]
➤ YN0000: jsonld@workspace:. STDOUT     
➤ YN0000: jsonld@workspace:. STDOUT     ERROR in multi ./lib/index.js
➤ YN0000: jsonld@workspace:. STDOUT     Module not found: Error: Can't resolve 'babel-loader' in '/tmp/xfs-294323b5'
➤ YN0000: jsonld@workspace:. STDOUT      @ multi ./lib/index.js jsonld[0]
➤ YN0000: jsonld@workspace:. STDOUT Child
➤ YN0000: jsonld@workspace:. STDOUT     Hash: c79e40343332f5386317
➤ YN0000: jsonld@workspace:. STDOUT     Time: 228ms
➤ YN0000: jsonld@workspace:. STDOUT     Built at: 07/22/2024 8:04:53 PM
➤ YN0000: jsonld@workspace:. STDOUT                 Asset      Size  Chunks         Chunk Names
➤ YN0000: jsonld@workspace:. STDOUT         jsonld.min.js  4.13 KiB       0         jsonld
➤ YN0000: jsonld@workspace:. STDOUT     jsonld.min.js.map  3.95 KiB       0  [dev]  jsonld
➤ YN0000: jsonld@workspace:. STDOUT     Entrypoint jsonld = jsonld.min.js jsonld.min.js.map
➤ YN0000: jsonld@workspace:. STDOUT     [0] multi ./lib/index.js 28 bytes {0} [built]
➤ YN0000: jsonld@workspace:. STDOUT     
➤ YN0000: jsonld@workspace:. STDOUT     ERROR in multi ./lib/index.js
➤ YN0000: jsonld@workspace:. STDOUT     Module not found: Error: Can't resolve 'babel-loader' in '/tmp/xfs-294323b5'
➤ YN0000: jsonld@workspace:. STDOUT      @ multi ./lib/index.js jsonld[0]
➤ YN0000: jsonld@workspace:. STDOUT     
➤ YN0000: jsonld@workspace:. STDOUT     ERROR in jsonld.min.js from Terser
➤ YN0000: jsonld@workspace:. STDOUT     Error: error:0308010C:digital envelope routines::unsupported
➤ YN0000: jsonld@workspace:. STDOUT         at new Hash (node:internal/crypto/hash:79:19)
➤ YN0000: jsonld@workspace:. STDOUT         at Object.createHash (node:crypto:139:10)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/terser-webpack-plugin-virtual-48436a27c6/3/home/dev/.yarn/berry/cache/terser-webpack-plugin-npm-1.4.5-d14c27a9f3-10c0.zip/node_modules/terser-webpack-plugin/dist/index.js:217:37
➤ YN0000: jsonld@workspace:. STDOUT         at Array.forEach (<anonymous>)
➤ YN0000: jsonld@workspace:. STDOUT         at TerserPlugin.optimizeFn (/tmp/xfs-294323b5/.yarn/__virtual__/terser-webpack-plugin-virtual-48436a27c6/3/home/dev/.yarn/berry/cache/terser-webpack-plugin-npm-1.4.5-d14c27a9f3-10c0.zip/node_modules/terser-webpack-plugin/dist/index.js:160:259)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.lazyCompileHook (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/Hook.js:154:20)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1409:36
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.lazyCompileHook (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/Hook.js:154:20)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1405:32
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.lazyCompileHook (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/Hook.js:154:20)
➤ YN0000: jsonld@workspace:. STDOUT         at Compilation.seal (/tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1342:27)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compiler.js:675:18
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1261:4
➤ YN0000: jsonld@workspace:. STDOUT Child
➤ YN0000: jsonld@workspace:. STDOUT     Hash: 0cc4e95202570e3f79f7
➤ YN0000: jsonld@workspace:. STDOUT     Time: 355ms
➤ YN0000: jsonld@workspace:. STDOUT     Built at: 07/22/2024 8:04:53 PM
➤ YN0000: jsonld@workspace:. STDOUT             Asset      Size  Chunks             Chunk Names
➤ YN0000: jsonld@workspace:. STDOUT     jsonld.esm.js  4.29 KiB  jsonld  [emitted]  jsonld
➤ YN0000: jsonld@workspace:. STDOUT     Entrypoint jsonld = jsonld.esm.js
➤ YN0000: jsonld@workspace:. STDOUT     [0] multi ./lib/index.js 28 bytes {jsonld} [built]
➤ YN0000: jsonld@workspace:. STDOUT     
➤ YN0000: jsonld@workspace:. STDOUT     ERROR in multi ./lib/index.js
➤ YN0000: jsonld@workspace:. STDOUT     Module not found: Error: Can't resolve 'babel-loader' in '/tmp/xfs-294323b5'
➤ YN0000: jsonld@workspace:. STDOUT      @ multi ./lib/index.js jsonld[0]
➤ YN0000: jsonld@workspace:. STDOUT Child
➤ YN0000: jsonld@workspace:. STDOUT     Hash: c79e40343332f5386317
➤ YN0000: jsonld@workspace:. STDOUT     Time: 308ms
➤ YN0000: jsonld@workspace:. STDOUT     Built at: 07/22/2024 8:04:53 PM
➤ YN0000: jsonld@workspace:. STDOUT                     Asset      Size  Chunks         Chunk Names
➤ YN0000: jsonld@workspace:. STDOUT         jsonld.esm.min.js  4.13 KiB       0         jsonld
➤ YN0000: jsonld@workspace:. STDOUT     jsonld.esm.min.js.map  3.95 KiB       0  [dev]  jsonld
➤ YN0000: jsonld@workspace:. STDOUT     Entrypoint jsonld = jsonld.esm.min.js jsonld.esm.min.js.map
➤ YN0000: jsonld@workspace:. STDOUT     [0] multi ./lib/index.js 28 bytes {0} [built]
➤ YN0000: jsonld@workspace:. STDOUT     
➤ YN0000: jsonld@workspace:. STDOUT     ERROR in multi ./lib/index.js
➤ YN0000: jsonld@workspace:. STDOUT     Module not found: Error: Can't resolve 'babel-loader' in '/tmp/xfs-294323b5'
➤ YN0000: jsonld@workspace:. STDOUT      @ multi ./lib/index.js jsonld[0]
➤ YN0000: jsonld@workspace:. STDOUT     
➤ YN0000: jsonld@workspace:. STDOUT     ERROR in jsonld.esm.min.js from Terser
➤ YN0000: jsonld@workspace:. STDOUT     Error: error:0308010C:digital envelope routines::unsupported
➤ YN0000: jsonld@workspace:. STDOUT         at new Hash (node:internal/crypto/hash:79:19)
➤ YN0000: jsonld@workspace:. STDOUT         at Object.createHash (node:crypto:139:10)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/terser-webpack-plugin-virtual-48436a27c6/3/home/dev/.yarn/berry/cache/terser-webpack-plugin-npm-1.4.5-d14c27a9f3-10c0.zip/node_modules/terser-webpack-plugin/dist/index.js:217:37
➤ YN0000: jsonld@workspace:. STDOUT         at Array.forEach (<anonymous>)
➤ YN0000: jsonld@workspace:. STDOUT         at TerserPlugin.optimizeFn (/tmp/xfs-294323b5/.yarn/__virtual__/terser-webpack-plugin-virtual-48436a27c6/3/home/dev/.yarn/berry/cache/terser-webpack-plugin-npm-1.4.5-d14c27a9f3-10c0.zip/node_modules/terser-webpack-plugin/dist/index.js:160:259)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.lazyCompileHook (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/Hook.js:154:20)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1409:36
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.lazyCompileHook (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/Hook.js:154:20)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1405:32
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
➤ YN0000: jsonld@workspace:. STDOUT         at AsyncSeriesHook.lazyCompileHook (/home/dev/.yarn/berry/cache/tapable-npm-1.1.3-f1c2843426-10c0.zip/node_modules/tapable/lib/Hook.js:154:20)
➤ YN0000: jsonld@workspace:. STDOUT         at Compilation.seal (/tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1342:27)
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compiler.js:675:18
➤ YN0000: jsonld@workspace:. STDOUT         at /tmp/xfs-294323b5/.yarn/__virtual__/webpack-virtual-9fcbf59e8a/3/home/dev/.yarn/berry/cache/webpack-npm-4.47.0-42e477a08c-10c0.zip/node_modules/webpack/lib/Compilation.js:1261:4
➤ YN0036: Prepack script failed (exit code 1, logs can be found here: /tmp/xfs-57c70697/prepack.log); run yarn prepack to investigate
➤ YN0000: Failed with errors in 6s 378ms

Problem #2

I tried installing webpack globally with npm i -g webpack but then I get this error:

dev@dev-VirtualBox:~/Documents/Git/ssi/jsonld-signatures$ yarn
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: jsonld@https://github.com/digitalcredentials/jsonld.js.git#commit=afa0062460b987bd42887b3a294cf0e0a0e5bde7: Manifest not found
    at cE.find (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:140:120099)
    at async /home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:520:11979
    at async Object.xZe (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:140:53732)
    at async B2.resolve (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:520:11940)
    at async Pd.resolve (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:141:1451)
    at async Pd.resolve (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:141:1451)
    at async /home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:210:7249
    at async Yy (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:140:53795)
    at async Z (/home/dev/.cache/node/corepack/v1/yarn/4.3.1/yarn.js:210:7231)
    at async Promise.allSettled (index 8)
➤ YN0000: └ Completed in 2s 884ms
➤ YN0000: · Failed with errors in 2s 904ms
@theblockstalk
Copy link
Author

Found this solution works: decentralized-identity/veramo#1407 (comment)

package.json

"resolutions": {
        "jsonld": "link:./node_modules/@digitalcredentials/jsonld",
    }

@alexfigtree
Copy link
Member

@theblockstalk Good to close?

@alexfigtree
Copy link
Member

@dmitrizagidulin FYI

@alexfigtree alexfigtree moved this to Follow-up in DCC Engineering Sep 26, 2024
@alexfigtree alexfigtree moved this from Follow-up to Done (Deployed) in DCC Engineering Oct 24, 2024
@alexfigtree
Copy link
Member

Closing this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (Deployed)
Development

No branches or pull requests

2 participants