Skip to content

AOT compilation disabled! when bundling meteor app for production #1934

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

Closed
pmcochrane opened this issue Jul 9, 2018 · 4 comments
Closed

Comments

@pmcochrane
Copy link

I am getting a similar message to #1922 saying that AOT is disabled when I am trying to package up my meteor app for production. I do not use the angular CLI and it is not installed (installing this globally seems to make no difference).

@angular/compiler-cli is a dev dependecy whereas @angular/compiler is a dependency in my package.json (which is the same as the example app).

Here is part of the log when bundling the app:

meteor npm install --production >/dev/null
	
NODE_OPTIONS=--max_old_space_size=4096 ROOT_URL=http://localhost:/ MAIL_URL=smtp://localhost:25 PORT=8400 AOT=1 meteor build --debug .dockerimage/ --directory --architecture os.linux.x86_64 --mobile-settings ./server/settings/dev.testing.json

WARNING: The output directory is under your source tree.
         Your generated files may get interpreted as source code!
         Consider building into a different directory instead
         meteor build ../output

@angular/compiler and @angular/compiler-cli must be installed for AOT compilation!
AOT compilation disabled!
Ignore this if you are using AngularJS 1.X

I've tried several times to get something installed that the compiler is happy with but AOT will not enable. I have forced @angular/compiler-cli to install after the install --production command. I have listed the installed npm's from within the deploy script and both of the mentioned npms are actually installed but the error message persists.

The actual error message is swallowed up in plugin/register.ts so it doesn't really tell you what the problem is. I debugged this by adding a console.error line to write out the error and it was complaining that typescript was not installed. Typescript is a dev dependency in my app (as well as installed globally)

Can you please update the error message to indicate that typescript is a requirement for AOT as well. It would also be useful if the actual error was printed to the console to assist in debugging any future issues.

@onhate
Copy link

onhate commented Jul 10, 2018

@angular/compiler and @angular/compiler-cli must be installed for AOT compilation!

those two packages should be installed globally in the machine running the build

npm install -g @angular/compiler @angular/compiler-cli

@ardatan
Copy link
Collaborator

ardatan commented Jul 10, 2018

@pmcochrane typescript is peer dependency of angular's compiler cli. You're right, we need to share error message as well. Thank you for contribution.
@onhate No, they do not have to be installed globally in the machine.

@aulra
Copy link

aulra commented Jul 15, 2018

How running with AOT in windows 10?

> AOT=1 ROLLUP=1 meteor --production

'AOT' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start:prod: `AOT=1 ROLLUP=1 meteor --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@ardatan
Copy link
Collaborator

ardatan commented Jul 15, 2018

@aulrahman Just run meteor --production
And if you'd like to use env variables, you have to learn how to use env variables on Windows. They're different from Linux;
https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt

@ardatan ardatan closed this as completed Aug 4, 2018
domq added a commit to domq/angular-meteor that referenced this issue May 2, 2023
I'm witnessing a resurgence of something that has the same symptoms as Urigo#1934, yet I followed all the instructions there. I assume that the to-do item of Urigo#1934 (comment) fell through the cracks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants