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

fix: use test mode as not production #1612

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rtritto
Copy link

@rtritto rtritto commented Dec 1, 2024

Test mode should be used for test and development and not for production.

@encore-cla
Copy link

encore-cla bot commented Dec 1, 2024

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why Encore requires a CLA and what the CLA includes.

Have you signed the CLA already but the status is still pending? Recheck it.

@eandre
Copy link
Member

eandre commented Dec 1, 2024

What problem is this change solving for you? I'm not sure this is the right thing to do to in the general case.

@rtritto rtritto changed the title fix: use NODE_ENV as not production fix: use test mode as not production Dec 1, 2024
@rtritto
Copy link
Author

rtritto commented Dec 1, 2024

In development, usually the process.env.NODE_ENV is undefined or development.
So when I started, I got:

file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/encore.dev-npm-1.44.6-3d86b75c4d-10c0.zip/node_modules/encore.dev/dist/internal/runtime/mod.js:5
export const RT = new Runtime({
                  ^

Error: failed to initialize runtime: unable to parse app metadata file

Caused by:
    failed to read file: The system cannot find the path specified. (os error 3)
    at file:///C:/test-encore-win/Local/Yarn/Berry/cache/encore.dev-npm-1.44.6-3d86b75c4d-10c0.zip/node_modules/encore.dev/dist/internal/runtime/mod.js:5:19
    at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:483:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  code: 'GenericFailure'
}

because of:

const testMode = process.env.NODE_ENV === "test";

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

Successfully merging this pull request may close these issues.

2 participants