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 fails when rootURL='' as default and rootURL set to '/' for test environment #1279

Closed
void-mAlex opened this issue Nov 10, 2022 · 1 comment

Comments

@void-mAlex
Copy link
Collaborator

Environment: development
cleaning up...
Build Error (WaitForTrees)

Could not find app javascript: "/assets/my-app.js" in tests/index.html. Found the following instead:
 - /testem.js
 - /assets/vendor.js
 - /assets/test-support.js
 - /assets/my-app.js
 - /assets/tests.js
 -

For more information about this error: https://github.com/thoov/stitch/wiki/Could-not-find-asset-in-entry-file-e
rror-help

the use case for relative url is when you need a build that can be deployed in any path relative to the server (note locationType has to be hash/none for the router to work in this config).
eg path:
https://example.com/app/ <--web app
https://localhost/ <-- wrapped hybrid app cordova/capacitor

currently this setup works in the classic build pipeline (though not sure if it's supported)

issues is that rootURL = '/' is required due to the setup of the testing pipeline and files. I have found no combination of rootURL that would make both /tests and ember test command with at the same time with embroider and allow a relative path
tried ../ /../ ./ in various combos between the different environments (dev / test)

it is theoretically possible to do two builds for this managing the rootURL by way of some env flag but that would be a major drawback for DX and overhead on the developer and CI resources

and now for what I've found is that

let rootURL = this.config.readConfig().rootURL;

always returns the development environment rootURL value even when receiving the tests/index.html values to check which are correctly prefixed with a different url

not sure what the fix is here but I guess this would work better if it read the correct config for the correct html file

@void-mAlex
Copy link
Collaborator Author

closing as fix has been merged and released

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