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

samples/universal-material-ui - gulp dev fails with Unhandled rejection SyntaxError: #129

Closed
claym opened this issue Jan 28, 2017 · 5 comments
Labels

Comments

@claym
Copy link

claym commented Jan 28, 2017

Did a fresh pull of electrode repo this morning, gulp dev fails.

Running on Windows 10
Node v6.9.4
npm 3.10.10

Quick search says this or something similar to #31

But that says fixed and it doesn't appear to be fixed :)

Register plugins failed { SyntaxError: C:/repo/electrode/samples/universal-material-ui/client/images/nature-600-337.jpg: Unexpected character '�' (1:0)
> 1 | ���� ►JFIF ☺☺☺ ` `  �� ;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 70
    | ^
  2 | �� C
  3 |♠
  4♂|
    at Parser.pp$5.raise (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:4333:13)
    at Parser.getTokenFromCode (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:1142:10)
    at Parser.readToken (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:771:19)
    at Parser.<anonymous> (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:6626:20)
    at Parser.readToken (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:5443:22)
    at Parser.nextToken (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:761:19)
    at Parser.parse (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:1616:10)
    at parse (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:6657:37)
    at File.parse (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\file\index.js:527:15)
    at File.parseCode (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\file\index.js:612:20)
    at C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\pipeline.js:49:12
    at File.wrap (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\file\index.js:574:16)
    at Pipeline.transform (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\pipeline.js:47:17)
    at Object.transformFileSync (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\api\node.js:152:10)
    at compile (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-register\lib\node.js:118:20)
    at loader (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-register\lib\node.js:144:14)
  pos: 0,
  loc: Position { line: 1, column: 0 },
  _babel: true,
  codeFrame: '> 1 | ����\u0000\u0010JFIF\u0000\u0001\u0001\u0001\u0000`\u0000`\u0000\u0000��\u0000;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 70\n    | ^\n  2 | ��\u0000
C\u0000\n  3 | \u0007\u0007\b\u0007\u0006\n  4 | \b\b\b\u000b' }

    ESERVERSTART

    This error is thrown by the electrode-server module

    There was an error starting the Hapi.js server
    Please check the output of the stack trace below and correct the error shown

    If you have followed this resolution step and you are still seeing an
    error, please file an issue on the electrode-server repository

    git+https://github.com/electrode-io/electrode-server.git

    C:/repo/electrode/samples/universal-material-ui/client/images/nature-600-337.jpg: Unexpected character '�' (1:0)

Unhandled rejection SyntaxError: C:/repo/electrode/samples/universal-material-ui/client/images/nature-600-337.jpg: Unexpected character '�' (1:0)
> 1 | ���� ►JFIF ☺☺☺ ` `  �� ;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 70
    | ^
  2 | �� C
  3 |♠
  4♂|
    at Parser.pp$5.raise (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:4333:13)
    at Parser.getTokenFromCode (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:1142:10)
    at Parser.readToken (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:771:19)
    at Parser.<anonymous> (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:6626:20)
    at Parser.readToken (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:5443:22)
    at Parser.nextToken (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:761:19)
    at Parser.parse (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:1616:10)
    at parse (C:\repo\electrode\samples\universal-material-ui\node_modules\babylon\lib\index.js:6657:37)
    at File.parse (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\file\index.js:527:15)
    at File.parseCode (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\file\index.js:612:20)
    at C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\pipeline.js:49:12
    at File.wrap (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\file\index.js:574:16)
    at Pipeline.transform (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\transformation\pipeline.js:47:17)
    at Object.transformFileSync (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-core\lib\api\node.js:152:10)
    at compile (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-register\lib\node.js:118:20)
    at loader (C:\repo\electrode\samples\universal-material-ui\node_modules\babel-register\lib\node.js:144:14)

Register plugins is taking a while - If this takes longer than 10 seconds, then
double check your plugins to make sure each one calls next() at the end.

Server will automatically abort after 20 seconds.
@jchip jchip added the bug label Jan 28, 2017
@jchip
Copy link
Member

jchip commented Jan 31, 2017

The reason for this is that our samples are always up to date with latest packages in the repo. To checkout a version of the samples that are up to date with the published packages, use the git tags for the [email protected]. For example, if you checkout the repo for [email protected] then the samples should work.

Also, you can run the samples with electrode packages come from the repo directly, by doing this:

npm run bootstrap
gulp samples-local
cd samples/<sample>
npm install

We will update our README to reflect this. Thanks for reporting the issue.

@jchip jchip added docs and removed bug labels Jan 31, 2017
@jchip
Copy link
Member

jchip commented Jan 31, 2017

actually I just did npm install with all of our published packages in the latest material-ui sample on OSX and it works. Maybe it's something with windows.

@claym
Copy link
Author

claym commented Feb 1, 2017

Looks like this guy had the issue as well? electrode-samples/electrode-react-sample-material-ui#2

I assume it builds in linux or mac osx?

@jchip
Copy link
Member

jchip commented Feb 2, 2017

yes, this is due to windows path \. fixed by electrode-io/isomorphic-loader@72fab0a.

@jchip jchip closed this as completed Feb 2, 2017
@claym
Copy link
Author

claym commented Feb 2, 2017

Looks like that fixed it. gulp dev runs, site comes up locally on Windows.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants