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

Passing variables to ae doesn't work when using minify = true (Windows) #41

Open
rafadess opened this issue Sep 24, 2020 · 2 comments
Open

Comments

@rafadess
Copy link

Passed variables to AE will fail if minify is set to true.
I have tested this on Windows only.

const projectPath = "some/path/to/aep";
ae.options.minify = true;
ae((path: string) => {
  const project = new File(path); // <-- path is undefined
  app.open(project);
}, projectPath);
@corluk
Copy link

corluk commented Sep 24, 2020

Can you please try with json object rather than string as argument?

@rafadess
Copy link
Author

Thank you for your quick reply.

I tested with json object but i got the same result.

const project = {
  path:
    "some/path/to/aep",
};
ae.options.minify = true;
ae((_project: any) => {
  console.log(_project.path); // <-- project is undefined
}, project);

I also created the script instead of running directly on AE. The difference that I notice was this:
minify = false

try {
(function (project) {
    console.log(project.path);
}).apply(this,[{"path":"some/path/to/aep"}]);
} catch (err) {
}

minify = false

try {
(function(o){console.log((void 0).path)}).apply(this,[{"path":"some/path/to/aep"}]);
} catch (err) {
}

The arguments passed was converted to (void 0). Don't know what it means but it might be useful to you.

Thanks for helping.

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

2 participants