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

Build error #753

Closed
jamiehewitt15 opened this issue Apr 19, 2021 · 12 comments · Fixed by #754 or #756
Closed

Build error #753

jamiehewitt15 opened this issue Apr 19, 2021 · 12 comments · Fixed by #754 or #756
Assignees
Labels
Type: Bug Something isn't working

Comments

@jamiehewitt15
Copy link
Member

It looks the Ocean.js isn't being built correctly when it's used with Ocean sub graph:

 Error: Cannot find module '/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/@oceanprotocol/lib/dist/lib.modern.js'
    at createEsmNotFoundErr (internal/modules/cjs/loader.js:907:15)
    at finalizeEsmResolution (internal/modules/cjs/loader.js:900:15)
    at resolveExports (internal/modules/cjs/loader.js:432:14)
    at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/runner/work/ocean-subgraph/ocean-subgraph/test/integration/Datatokens.test.ts:5:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Module.m._compile (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/ts-node/src/index.ts:1056:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.require.extensions.<computed> [as .ts] (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.exports.requireOrImport (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/mocha/lib/esm-utils.js:42:12)
    at Object.exports.loadFilesAsync (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/mocha/lib/esm-utils.js:55:34)
    at Mocha.loadFilesAsync (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/mocha/lib/mocha.js:473:19)
    at singleRun (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/mocha/lib/cli/run-helpers.js:125:15)
    at exports.runMocha (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/mocha/lib/cli/run-helpers.js:190:10)
    at Object.exports.handler (/home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/mocha/lib/cli/run.js:362:11)
    at /home/runner/work/ocean-subgraph/ocean-subgraph/node_modules/yargs/build/index.cjs:443:71
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ocean-subgraph@1.1.1 test-integration: `TS_NODE_PROJECT='test/integration/tsconfig.json' mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ocean-subgraph@1.1.1 test-integration script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-04-19T01_07_27_888Z-debug.log
Error: Process completed with exit code 1.
@jamiehewitt15 jamiehewitt15 added the Type: Bug Something isn't working label Apr 19, 2021
@jamiehewitt15 jamiehewitt15 self-assigned this Apr 19, 2021
@jamiehewitt15
Copy link
Member Author

@jamiehewitt15
Copy link
Member Author

I think the issue could be caused by the wrong name in the "exports" field within package.json: https://github.com/oceanprotocol/ocean.js/pull/754/files

@jamiehewitt15
Copy link
Member Author

I re-ran the build job in the Ocean Sub Graph and it's still giving the same error: https://github.com/oceanprotocol/ocean-subgraph/runs/2380269955?check_suite_focus=true

@alexcos20
Copy link
Member

We need to release a new ocean.js first and bump it in subgraph. Doing that now

@jamiehewitt15
Copy link
Member Author

Ok cool, thank you

@alexcos20
Copy link
Member

@alexcos20
Copy link
Member

if it helps @jamiehewitt15 👍

/ocean/ocean-subgraph$ ls node_modules/@oceanprotocol/lib/dist/node/
balancer/ exchange/ lib.d.ts lib.module.js lib.umd.js.map ocean/
datatokens/ index.d.ts lib.js lib.module.js.map metadatacache/ provider/
ddo/ Instantiable.abstract.d.ts lib.js.map lib.umd.js models/ utils/

I can see lib.module.js in node_modules/@oceanprotocol/lib/dist/node/ and not in node_modules/@oceanprotocol/lib/dist/

@jamiehewitt15
Copy link
Member Author

@alexcos20 Thank you for pointing that out. I have updated the paths here: https://github.com/oceanprotocol/ocean.js/pull/756/files

@alexcos20
Copy link
Member

and still fails: https://github.com/oceanprotocol/ocean-subgraph/pull/89/checks?check_run_id=2382858822
this time with another error

This was referenced Apr 20, 2021
@jamiehewitt15
Copy link
Member Author

jamiehewitt15 commented Apr 20, 2021

This is what I was suggesting on the call, potentially trying to use the Common JS bundle rather than the ESM module: https://github.com/oceanprotocol/ocean.js/pull/761/files

I'll try and test it locally with Ocean sub graph

@jamiehewitt15
Copy link
Member Author

@alexcos20 I tested out pull request #761 with Ocean sub graph using npm link and the integration tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment