React-styleguidist: Module parse failed: 'import' and 'export' may only appear at the top level (36:3)

Created on 6 Feb 2019  路  3Comments  路  Source: styleguidist/react-styleguidist

Current behavior

When I run the command styleguidist server, I receive an error in regards to a module parse failed. It asks for the appropriate loader. I have tried multiple configurations with my webpack and babel file and still no solution.

screen shot 2019-02-06 at 9 47 42 am

To reproduce

https://github.com/dzimmerman902/gcl

Expected behavior

I expect to not receive this error when running the command npm run styleguide

Most helpful comment

I got the same problem. So for anyone that ends up here, in my case it was because [email protected] triggered an old peerDependency npm bug, downgrading to [email protected] should fix or do one of the following listed here

All 3 comments

@dzimmerman902 Why did you close this issue. Have you solved this behavior ?

Hey,

My bad for not writing anything. I started the project over and for some reason it decided to work. I don't know for sure what I did differently. The only thing I can think of was switching the file name from babel.config.js to .babelrc.

I got the same problem. So for anyone that ends up here, in my case it was because [email protected] triggered an old peerDependency npm bug, downgrading to [email protected] should fix or do one of the following listed here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mheathcote1977 picture mheathcote1977  路  3Comments

vchoisk picture vchoisk  路  3Comments

ZwaarContrast picture ZwaarContrast  路  4Comments

eduardoinnorway picture eduardoinnorway  路  3Comments

davidjb picture davidjb  路  3Comments