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

Can not work with prettier@1.13.0 #108

Closed
starkwang opened this issue May 28, 2018 · 6 comments
Closed

Can not work with prettier@1.13.0 #108

starkwang opened this issue May 28, 2018 · 6 comments

Comments

@starkwang
Copy link

(node:91242) UnhandledPromiseRejectionWarning: Error: No parser and no file path given, couldn't infer a parser.
    at normalize (/usr/local/lib/node_modules/svgr/node_modules/prettier/index.js:7051:13)
    at formatWithCursor (/usr/local/lib/node_modules/svgr/node_modules/prettier/index.js:10370:12)
    at /usr/local/lib/node_modules/svgr/node_modules/prettier/index.js:31115:15
    at Object.format (/usr/local/lib/node_modules/svgr/node_modules/prettier/index.js:31134:12)
    at _default (/usr/local/lib/node_modules/svgr/lib/plugins/prettier.js:10:50)
    at /usr/local/lib/node_modules/svgr/lib/index.js:96:61
    at Generator.next (<anonymous>)
    at step (/usr/local/lib/node_modules/svgr/lib/index.js:61:221)
    at _next (/usr/local/lib/node_modules/svgr/lib/index.js:61:409)
    at <anonymous>
(node:91242) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:91242) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This can be fixed by npm install prettier@1.12.1.

Ref: prettier/prettier#4567

In prettier 1.13.0, default parser was removed with a minor version(used to be babylon)

starkwang added a commit to starkwang/svgr that referenced this issue May 28, 2018
Prettier is no longer support default parser since 1.13.0.
This change is to add `parser: 'babylon'` into prettier options.

Fix: gregberge#108
gregberge added a commit that referenced this issue May 28, 2018
@w3nda
Copy link

w3nda commented May 28, 2018

This is not solved yet.. tried npm i --save svgr@latest
still no parser..

@gregberge
Copy link
Owner

gregberge commented May 28, 2018

@wenduzer I forgot the npm publish, should be OK now.

@w3nda
Copy link

w3nda commented May 29, 2018

image
@neoziro any clue?

@gregberge
Copy link
Owner

It looks like you are using url loader not svgr loader. Probably a problem in your webpack config.

@w3nda
Copy link

w3nda commented May 29, 2018

@neoziro did everything by the book tho.
this is in my webpack config -
image
the import -
image

@w3nda
Copy link

w3nda commented Jun 8, 2018

any help? @neoziro

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

Successfully merging a pull request may close this issue.

3 participants