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

import Hello ^ Syntax Error #345

Open
jhammars opened this issue Nov 27, 2017 · 5 comments
Open

import Hello ^ Syntax Error #345

jhammars opened this issue Nov 27, 2017 · 5 comments

Comments

@jhammars
Copy link

As a beginner, it is kind of hard to figure out what syntax is supported out of the box. For example


let Hello = 'Hi';
export default Hello;

import Hello from './components/hello';
console.log(Hello);

..will throw the error: "Hmmm. We're having trouble parsing a file.".

More clear docs/readme regarding what syntax to use would be awesome.

@yoshuawuyts
Copy link
Member

Oh, that's odd — I'm not getting the same error for similar code. Could you perhaps create a repro? Thanks!

@jhammars
Copy link
Author

jhammars commented Dec 8, 2017

Seems like I missed the crucial part that generated the error. Here is a repo to replicate: https://github.com/jhammars/bankai-import-hello

, where this commented line somehow is causing the error: https://github.com/jhammars/bankai-import-hello/blob/master/src/index.js#L1

@Flet
Copy link
Collaborator

Flet commented Dec 12, 2017

It looks like the sheetify transform does not like the import line.
https://github.com/choojs/bankai/blob/master/lib/graph-script.js#L53

Commenting it out the sheetify transform allows this to run.

I tried moving the sheetify transform to after the babeliy transform, but the error is still thrown. :(

@Flet
Copy link
Collaborator

Flet commented Dec 12, 2017

Oh interesting!
If the // sheetify comment is removed from here:
https://github.com/jhammars/bankai-import-hello/blob/master/src/index.js#L1

Then it works!

I think this is related to stackcss/sheetify#131

@jhammars
Copy link
Author

jhammars commented Dec 13, 2017

Yes, It's a little peculiar. The word "sheetify" is explicitly causing the error, even when it is in a comment. Spell sheetify wrong and you are all good =)

And yes, it looks like it might be related to stackcss/sheetify#131

image

The problem for me personally, as a JS beginner, is that I have no clue how to use sheetify in combination with ES6 module syntax. If the docs would say that ES6 module syntax is not currently recommended, it would be of great help imo.

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