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

Unterminated string constant #16561

Open
3 of 7 tasks
allthesignals opened this issue Apr 30, 2020 · 4 comments
Open
3 of 7 tasks

Unterminated string constant #16561

allthesignals opened this issue Apr 30, 2020 · 4 comments

Comments

@allthesignals
Copy link

(This is cross-posted from the issue here FortAwesome/ember-fontawesome#143, I am opening an issue here in hopes of finding some hints on where in the stack this might be coming from)

Describe the bug
I've run into a really baffling problem where I cannot get my app to build due to an "unterminated string constant" during the rollup process.

image

To Reproduce
Insert a URL to your test case - use codepen.io, jsfiddle.net, jsbin.com, codesandbox.io, or whatever.

Describe any details about the test case that we need to know like "whatever you do, don't click the red button."

Here's my yarn.lock: https://gist.github.com/allthesignals/9ff91ab416910c26edfb1278f2cbcb3f#file-yarn-lock

Here are the contents of the log file.

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

ENV Summary:

TIME: Tue Apr 21 2020 22:33:12 GMT-0400 (Eastern Daylight Time)
TITLE: ember
ARGV:

  • /Users/wmattgardner/.nvm/versions/node/v10.15.3/bin/node
  • /usr/local/bin/ember
  • s
    EXEC_PATH: /Users/wmattgardner/.nvm/versions/node/v10.15.3/bin/node
    TMPDIR: /var/folders/x5/wkqy3c414sjgdr1j2498xzq40000gr/T
    SHELL: /bin/bash
    PATH:
  • /Users/wmattgardner/.rvm/gems/ruby-2.6.4/bin
  • /Users/wmattgardner/.rvm/gems/ruby-2.6.4@global/bin
  • /Users/wmattgardner/.rvm/rubies/ruby-2.6.4/bin
  • /Users/wmattgardner/.nvm/versions/node/v10.15.3/bin
  • ~/bin
  • /usr/local/sbin
  • /usr/local/bin
  • /usr/bin
  • /bin
  • /usr/sbin
  • /sbin
  • /Users/wmattgardner/.rvm/bin
    PLATFORM: darwin x64
    FREEMEM: 50106368
    TOTALMEM: 8589934592
    UPTIME: 2872
    LOADAVG: 16.23779296875,11.29345703125,9.470703125
    CPUS:
  • Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz - 2300
  • Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz - 2300
  • Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz - 2300
  • Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz - 2300
    ENDIANNESS: LE
    VERSIONS:
  • ares: 1.15.0
  • cldr: 33.1
  • http_parser: 2.8.0
  • icu: 62.1
  • modules: 64
  • napi: 3
  • nghttp2: 1.34.0
  • node: 10.15.3
  • openssl: 1.1.0j
  • tz: 2018e
  • unicode: 11.0
  • uv: 1.23.2
  • v8: 6.8.275.32-node.51
  • zlib: 1.2.11

ERROR Summary:

  • broccoliBuilderErrorStack: Error: Unterminated string constant
    at error (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:224:15)
    at Module.error (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:16788:9)
    at tryParse (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:16459:16)
    at Module.setSource (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:16514:24)
    at /Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:19375:20
  • code: [undefined]
  • codeFrame: Unterminated string constant
  • errorMessage: Unterminated string constant
    at free-solid-svg-icons-rollup
    -- created here: --
    at new Plugin (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-plugin/index.js:7:31)
    at new Rollup (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/dist/index.js:39:9)
    at Object.keys.forEach.pack (/Users/wmattgardner/labs-zap-search/node_modules/@fortawesome/ember-fontawesome/index.js:37:26)
    at Array.forEach ()
    at Class.treeForVendor (/Users/wmattgardner/labs-zap-search/node_modules/@fortawesome/ember-fontawesome/index.js:26:47)
    at Class._treeFor (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/models/addon.js:668:33)
    at Class.treeFor (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/models/addon.js:628:21)
    at project.addons.reduce (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/broccoli/ember-app.js:701:26)
    at Array.reduce ()
    at EmberApp._addonTreesFor (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/broccoli/ember-app.js:699:32)
    -- (end) --
  • errorType: Build Error
  • location:
    • column: [undefined]
    • file: [undefined]
    • line: [undefined]
    • treeDir: [undefined]
  • message: Unterminated string constant
    at free-solid-svg-icons-rollup
    -- created here: --
    at new Plugin (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-plugin/index.js:7:31)
    at new Rollup (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/dist/index.js:39:9)
    at Object.keys.forEach.pack (/Users/wmattgardner/labs-zap-search/node_modules/@fortawesome/ember-fontawesome/index.js:37:26)
    at Array.forEach ()
    at Class.treeForVendor (/Users/wmattgardner/labs-zap-search/node_modules/@fortawesome/ember-fontawesome/index.js:26:47)
    at Class._treeFor (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/models/addon.js:668:33)
    at Class.treeFor (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/models/addon.js:628:21)
    at project.addons.reduce (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/broccoli/ember-app.js:701:26)
    at Array.reduce ()
    at EmberApp._addonTreesFor (/Users/wmattgardner/labs-zap-search/node_modules/ember-cli/lib/broccoli/ember-app.js:699:32)
    -- (end) --
  • name: Error
  • nodeAnnotation: [undefined]
  • nodeName: free-solid-svg-icons-rollup
  • originalErrorMessage: Unterminated string constant
  • stack: Error: Unterminated string constant
    at error (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:224:15)
    at Module.error (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:16788:9)
    at tryParse (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:16459:16)
    at Module.setSource (/Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:16514:24)
    at /Users/wmattgardner/labs-zap-search/node_modules/broccoli-rollup/node_modules/rollup/dist/rollup.js:19375:20

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

Version and implementation

    "@fortawesome/ember-fontawesome": "^0.2.1",
    "@fortawesome/free-brands-svg-icons": "^5.2.0",
    "@fortawesome/free-regular-svg-icons": "^5.1.0",
    "@fortawesome/free-solid-svg-icons": "^5.2.0",
  • SVG with JS
  • Web Fonts with CSS
  • SVG Sprites
  • On the Desktop

Bug report checklist

  • I have filled out as much of the above information as I can
  • I have included a test case because my odds go way up that the team can fix this when I do
  • I have searched for existing issues and to the best of my knowledge this is not a duplicate
@tagliala
Copy link
Member

tagliala commented May 1, 2020

Hi!

Thanks for being part of the Font Awesome Community.

Will leave this open for feedback from the community, but I can't personally help, sorry

@caprica-Six
Copy link

caprica-Six commented Jul 2, 2020

Experienced the same issue here as well.
Font-awesome versions:

"@fortawesome/fontawesome-free": "^5.12.1",
    "@fortawesome/fontawesome-svg-core": "^1.2.28",
    "@fortawesome/free-solid-svg-icons": "^5.13.0",
    "@fortawesome/react-fontawesome": "^0.1.9"

Screenshot 2020-07-02 at 18 20 26

So, what actually fixed it was:

  • rm -rf node_modules
  • npm cache verify
  • kill terminal
  • kill VSCode
  • re-start machine
    worked!

@jdhankins
Copy link

jdhankins commented Jul 22, 2020

Same:
"@fortawesome/fontawesome-svg-core": "^1.2.30", "@fortawesome/free-brands-svg-icons": "^5.14.0", "@fortawesome/free-regular-svg-icons": "^5.14.0", "@fortawesome/free-solid-svg-icons": "^5.14.0", "@fortawesome/react-fontawesome": "^0.1.11",

./node_modules/@fortawesome/free-solid-svg-icons/index.es.js SyntaxError: /Users/xxxxx/Development/source/xx-xxx-xxx/node_modules/@fortawesome/free-solid-svg-icons/index.es.js: Unterminated string constant (2615:31)
2613 | prefix: 'fas', 2614 | iconName: 'layer-group',
> 2615 | icon: [512, 512, [], "f5fd", "M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87

The index.es.js file seems to be truncated for some reason.

I resolved with the following steps:

  1. rm yarn cache dir
  2. npm cache rm --force
  3. rm yarn.lock
  4. rm -rf node_modules
  5. yarn install

I'm not sure which one of these fixed the issue, but hope this helps.
`

@godfreyyeung
Copy link

In addition to the steps from previous two answers, running yarn cache clean helped me

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

5 participants