Urigo/angular-meteor

Angular compilers - exports is not defined

davinciagf opened this issue · 2 comments

Hi,
I have an meteor (v1.5.1)/angular(v5.2.0) that I have updated to meteor v1.7.0.4.
During this update, I have also removed the old angular compiler (angular2-compilers) and I have installed the new angular-compilers.
Unfortunately when I start my app with the new version of meteor, I encountered an error during the compilation:

/.meteor/packages/meteor-tool/.1.7.0_4.1f19397++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280`
W20180817-13:05:01.822(2)? (STDERR) throw(ex);
W20180817-13:05:01.822(2)? (STDERR) ^
W20180817-13:05:01.823(2)? (STDERR)
W20180817-13:05:01.823(2)? (STDERR) ReferenceError: exports is not defined

The meteor packages file is:

meteor-base@1.4.0             # Packages every Meteor app needs to have
mobile-experience@1.0.5       # Packages for a great mobile UX
mongo@1.5.0                   # The database Meteor supports right now
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.2.0                 # Meteor's client-side reactive programming library

standard-minifier-css@1.4.1   # CSS minifier run for production mode
standard-minifier-js@2.3.4    # JS minifier run for production mode
es5-shim@4.8.0                # ECMAScript 5 compatibility for older browsers.

practicalmeteor:mocha
xolvio:cleaner
dispatch:mocha-phantomjs
shell-server@0.3.1
accounts-password@1.5.1
email@1.2.3
browser-policy@1.1.0
meteorhacks:inject-initial
dynamic-import@0.4.0

underscore@1.0.10
angular-compilers

The tsconfig.json file is:

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "es6",
      "dom"
    ],
    "module": "commonjs",
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "sourceMap": true
  },
  "exclude": [
    "node_modules"
  ],
  "files": [
    "typings.d.ts"
  ],
  "compileOnSave": false,
  "angularCompilerOptions": {
    "genDir": "aot",
    "skipMetadataEmit": true
  }
}

This error seems similar to the #1906

Thanks

Having the same issue: ReferenceError: exports is not defined
at .meteor\local\build\programs\server\app\server\main.js:9:23

I have fixed this issue by adding the ecmascript package (ecmascript@0.11.1)
meteor add ecmascript

FYI, please find the sequence of commands to update a meteor v1.5.1 (angular(v5.2.0)) app to meteor v1.7.0.5:
meteor update --patch - to v1.5.4.2 (I have also updated the accounts-password package)
meteor update - to v1.7.0.5
meteor reset- !!! Reset the current project to a fresh state. Removes the local mongo database !!!
meteor remove angular2-compilers
meteor add angular-compilers
meteor npm install @babel/runtime@7.0.0-beta.55
meteor add ecmascript

I hope this information helps