ivanvanderbyl / ember-cli-critical

Ember CLI addon which wraps Critical, to extract & inline critical-path (above-the-fold) CSS from HTML
MIT License
11 stars 4 forks source link

Unexpected token ) #3

Open dilrajahdan opened 6 years ago

dilrajahdan commented 6 years ago

Hi,

Node: v7.6.0 NPM: 3.9.5

I'm getting the following error after when running ember s

$ ember s
Unexpected token )
/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli-critical/index.js:50
      )
      ^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Function.Addon.lookup (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/models/addon.js:1641:19)
    at graph.each (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/models/addons-factory.js:54:38)
    at Vertices.each (/Users/superluvdub/Web/bg/help-and-support/node_modules/dag-map/dag-map.umd.js:197:13)
    at Vertices.walk (/Users/superluvdub/Web/bg/help-and-support/node_modules/dag-map/dag-map.umd.js:125:14)
    at DAG.each (/Users/superluvdub/Web/bg/help-and-support/node_modules/dag-map/dag-map.umd.js:68:24)
    at AddonsFactory.initializeAddons (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/models/addons-factory.js:45:11)
    at Project.initializeAddons (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/models/project.js:444:38)
    at Project.eachAddonCommand (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/models/project.js:506:12)
    at module.exports (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/cli/lookup-command.js:33:13)
    at RSVP.hash.then.environment (/Users/superluvdub/Web/bg/help-and-support/node_modules/ember-cli/lib/cli/cli.js:97:28)
    at tryCatch (/Users/superluvdub/Web/bg/help-and-support/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/Users/superluvdub/Web/bg/help-and-support/node_modules/rsvp/dist/rsvp.js:538:13)
    at /Users/superluvdub/Web/bg/help-and-support/node_modules/rsvp/dist/rsvp.js:606:14
    at flush (/Users/superluvdub/Web/bg/help-and-support/node_modules/rsvp/dist/rsvp.js:2415:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

ember-cli-build.js

  assetOptions['ember-cli-critical'] = {
    enabled: true,
    critical: {
      // critical options
      inline: true,
      base: 'dist/',
      src: 'index.html',
      dest: 'index-critical.html',
      // dest: 'styles/hands.css',
      width: 1300,
      height: 900    
    }
  };

package.json

"ember-cli-critical": "^0.1.1"

Any ideas what I'm doing wrong?

dilrajahdan commented 6 years ago

When i remove the , from line 49 in node_modules/ember-cli-critical/index.js ... it fixes the issue.

Should I raise a PR for this?