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

Causing in Unexpected Token: eof (undefined) when building for production #343

Open
aman-adriano opened this issue May 4, 2020 · 3 comments

Comments

@aman-adriano
Copy link

I got this error when building for productiong (ember b --prod):

Build Error (UglifyWriter)

Unexpected token: eof (undefined)

Here's the full error log 👍

ENV Summary:

TIME: Mon May 04 2020 11:38:57 GMT+0800 (Philippine Standard Time)
TITLE: ember
ARGV:

  • /usr/local/bin/node
  • /home/aman/.npm-global/bin/ember
  • b
  • --prod
    EXEC_PATH: /usr/local/bin/node
    TMPDIR: /tmp
    SHELL: /bin/bash
    PATH:
  • /home/aman/.config/composer/vendor/bin
  • /home/aman/.npm-global/bin
  • /home/aman/android-studio/bin
  • /usr/local/sbin
  • /usr/local/bin
  • /usr/sbin
  • /usr/bin
  • /sbin
  • /bin
  • /usr/games
  • /usr/local/games
  • /snap/bin
  • ~/Downloads/android-sdk-linux/platform-tools
  • ~/flutter/bin
  • ~/Downloads/android-sdk-linux
    PLATFORM: linux x64
    FREEMEM: 1545768960
    TOTALMEM: 8010620928
    UPTIME: 1306
    LOADAVG: 1.4599609375,0.95849609375,0.73779296875
    CPUS:
  • Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz - 2610
  • Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz - 2639
  • Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz - 2596
  • Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz - 2618
    ENDIANNESS: LE
    VERSIONS:
  • ares: 1.14.0
  • cldr: 33.1
  • http_parser: 2.8.0
  • icu: 62.1
  • modules: 64
  • napi: 3
  • nghttp2: 1.34.0
  • node: 10.13.0
  • openssl: 1.1.0i
  • tz: 2018e
  • unicode: 11.0
  • uv: 1.23.2
  • v8: 6.8.275.32-node.36
  • zlib: 1.2.11

ERROR Summary:

  • broccoliBuilderErrorStack: SyntaxError: Unexpected token: eof (undefined)
    at ee (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:19603)
    at c (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28093)
    at l (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28184)
    at f (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28237)
    at N (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:38341)
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:30437
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28825
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:32169
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:32279
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28825
  • code: [undefined]
  • codeFrame: Unexpected token: eof (undefined)
  • errorMessage: Unexpected token: eof (undefined)
    at UglifyWriter
    -- created here: --
    at UglifyWriter.Plugin (/home/aman/Dev/scorpio/stacs-ui/node_modules/broccoli-plugin/index.js:7:31)
    at new UglifyWriter (/home/aman/Dev/scorpio/stacs-ui/node_modules/broccoli-uglify-sourcemap/index.js:38:10)
    at UglifyWriter (/home/aman/Dev/scorpio/stacs-ui/node_modules/broccoli-uglify-sourcemap/index.js:33:12)
    at Class.postprocessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli-uglify/index.js:54:50)
    at projectOrAddon.addons.reduce (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce ()
    at addonProcessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/broccoli/ember-app.js:866:12)
    at EmberApp.host.addonPostprocessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-auto-import/js/auto-import.js:108:20)
    at EmberApp.toTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/broccoli/ember-app.js:1825:17)
    -- (end) --
  • errorType: Build Error
  • location:
    • column: [undefined]
    • file: [undefined]
    • line: 101860
    • treeDir: [undefined]
  • message: Unexpected token: eof (undefined)
    at UglifyWriter
    -- created here: --
    at UglifyWriter.Plugin (/home/aman/Dev/scorpio/stacs-ui/node_modules/broccoli-plugin/index.js:7:31)
    at new UglifyWriter (/home/aman/Dev/scorpio/stacs-ui/node_modules/broccoli-uglify-sourcemap/index.js:38:10)
    at UglifyWriter (/home/aman/Dev/scorpio/stacs-ui/node_modules/broccoli-uglify-sourcemap/index.js:33:12)
    at Class.postprocessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli-uglify/index.js:54:50)
    at projectOrAddon.addons.reduce (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce ()
    at addonProcessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
    at EmberApp.addonPostprocessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/broccoli/ember-app.js:866:12)
    at EmberApp.host.addonPostprocessTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-auto-import/js/auto-import.js:108:20)
    at EmberApp.toTree (/home/aman/Dev/scorpio/stacs-ui/node_modules/ember-cli/lib/broccoli/ember-app.js:1825:17)
    -- (end) --
  • name: BuildError
  • nodeAnnotation: [undefined]
  • nodeName: UglifyWriter
  • originalErrorMessage: Unexpected token: eof (undefined)
  • stack: SyntaxError: Unexpected token: eof (undefined)
    at ee (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:19603)
    at c (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28093)
    at l (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28184)
    at f (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28237)
    at N (/home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:38341)
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:30437
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28825
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:32169
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:32279
    at /home/aman/Dev/scorpio/stacs-ui/node_modules/terser/dist/bundle.min.js:1:28825

=================================================================================

My env info:
ember-cli: 3.15.2
node: 10.13.0
os: linux x64

It builds normally when I removed this addon.

Thanks

@sbflynn
Copy link

sbflynn commented May 4, 2020

I had the same issue. The root cause of it was the recently released moment v2.25.1 package. Workaround was to pin moment to v2.24.0 (yarn resolution worked for me).

@aman-adriano
Copy link
Author

thanks @sbflynn

Is momentjs is a dependency of ember-pikaday through ember-cli-moment-shim?
I don't see it in pikaday's depencies.
Glad to know I'm not the only one having this issue.

@jrjohnson
Copy link
Contributor

jrjohnson commented May 11, 2020

This should be fixed with the release of ember-moment-shim v3.8.0 which no longer double minifies code from moment.

czosel added a commit to czosel/ember-caluma that referenced this issue Apr 6, 2021
The issue that made us downgrade moment has been fixed in
ember-moment-shim 3.8.0.
adopted-ember-addons/ember-pikaday#343
czosel added a commit to czosel/ember-caluma that referenced this issue Apr 6, 2021
The issue that made us downgrade moment has been fixed in
ember-moment-shim 3.8.0.
adopted-ember-addons/ember-pikaday#343
czosel added a commit to czosel/ember-caluma that referenced this issue Apr 6, 2021
The issue that made us downgrade moment has been fixed in
ember-moment-shim 3.8.0.
adopted-ember-addons/ember-pikaday#343
czosel added a commit to czosel/ember-caluma that referenced this issue Apr 6, 2021
The issue that made us downgrade moment has been fixed in
ember-moment-shim 3.8.0.
adopted-ember-addons/ember-pikaday#343
czosel added a commit to projectcaluma/ember-caluma that referenced this issue Apr 6, 2021
The issue that made us downgrade moment has been fixed in
ember-moment-shim 3.8.0.
adopted-ember-addons/ember-pikaday#343
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

3 participants