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 and serve different behaviour #82

Open
spruce opened this issue Mar 18, 2022 · 1 comment
Open

Build and serve different behaviour #82

spruce opened this issue Mar 18, 2022 · 1 comment

Comments

@spruce
Copy link

spruce commented Mar 18, 2022

The problem is that I want to use a composite inside another composite (both authored in TS). Therefore I require it like this:

import "inner-component/loader"

Locally I run always run ojet serve which works fine for me but the build locally and on the CI fails.

To reproduce simply create two composites where the outer composite needs to display the inner composite. That should work or am I making an obvious mistake?

I'm using package.json-scripts to use the locally installed ojet-cli for building and serving, but am still on the newest version

npx ojet -v
Oracle JET Command Line Interface, version: 12.0.0
Running component requirejs task for outer-component/loader
Error: Error: ENOENT: no such file or directory, open '/project/web/js/jet-composites/outer-component/1.0.0/inner-component/loader.js'
In module tree:
    outer-component/loader
      outer-component/outer-component-viewModel

    at Object.openSync (fs.js:497:3)

    at /project/node_modules/requirejs/bin/r.js:28332:19
    at /project/node_modules/requirejs/bin/r.js:3059:39
    at /project/node_modules/requirejs/bin/r.js:2999:25
    at Function.prim.nextTick (/project/node_modules/requirejs/bin/r.js:28083:9)
    at Object.errback (/project/node_modules/requirejs/bin/r.js:2998:26)
    at Object.callback (/project/node_modules/requirejs/bin/r.js:2984:23)
    at Object.then (/project/node_modules/requirejs/bin/r.js:3038:23)
    at build (/project/node_modules/requirejs/bin/r.js:28289:12)
    at runBuild (/project/node_modules/requirejs/bin/r.js:30302:17)
    at Object.execCb (/project/node_modules/requirejs/bin/r.js:1946:33) {
  originalError: Error: ENOENT: no such file or directory, open '/project/web/js/jet-composites/outer-component/1.0.0/inner-component/loader.js'
      at Object.openSync (fs.js:497:3)
      at Object.readFileSync (fs.js:393:35)
      at Object.readFile (/project/node_modules/requirejs/bin/r.js:3658:27)
      at Object.readFileAsync (/project/node_modules/requirejs/bin/r.js:3672:32)
      at Function.require._cacheReadAsync (/project/node_modules/requirejs/bin/r.js:28102:25)
      at /project/node_modules/requirejs/bin/r.js:27671:48
      at /project/node_modules/requirejs/bin/r.js:3041:37
      at /project/node_modules/requirejs/bin/r.js:2989:25
      at Function.prim.nextTick (/project/node_modules/requirejs/bin/r.js:28083:9)
      at Object.callback (/project/node_modules/requirejs/bin/r.js:2988:26) {
    errno: -2,
    syscall: 'open',
    code: 'ENOENT',
    path: '/project/web/js/jet-composites/outer-component/1.0.0/inner-component/loader.js',
    fileName: '/project/web/js/jet-composites/outer-component/1.0.0/inner-component/loader.js',
    moduleTree: [
      'outer-component/outer-component-viewModel',
      'outer-component/loader'
    ]
  }
}
@spruce
Copy link
Author

spruce commented Mar 30, 2022

Expanding on this. The build command always returns 0 as the status code on Linux. This leads to our CI scripts not noticing the error and assuming the build was successful which it definitely was not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant