Skip to content

Can not work with prettier@1.13.0 #108

@starkwang

Description

@starkwang
(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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions