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

Extract fails when files do not have import from 'lingui-react' #62

Closed
felipeko opened this issue Aug 17, 2017 · 6 comments
Closed

Extract fails when files do not have import from 'lingui-react' #62

felipeko opened this issue Aug 17, 2017 · 6 comments

Comments

@felipeko
Copy link
Contributor

Hi, i'm setting up lingui on my project, but i wont need i18n for all files, but i get the following errors when using extract on the project:
image

Individual files that import {Trans} work fine. Is there any way to just ignore files without import and keep extracting others?

Thanks.

@tricoder42
Copy link
Contributor

This shouldn't been happening after latest release of CLI (lingui-cli@1.0.5) and extract plugin (babel-plugin-lingui-extract-messages@1.0.3). I'll take a look

You can also ignore individual files or patterns with srcPathIgnorePatterns option as a temporary fix (see https://lingui.gitbooks.io/js/ref/cli.html#srcpathignorepatterns-array).

@matuscongrady
Copy link

Using latest release (lingui-cli@1.0.5) and extract plugin (babel-plugin-lingui-extract-messages@1.0.3).

Issue still persists.

@tricoder42
Copy link
Contributor

I'm not able to reproduce this bug.

It's the very same error? Could you please paste the file which causes this error?

@felipeko
Copy link
Contributor Author

felipeko commented Aug 21, 2017

Any simple file can cause this, for example:

import React from 'react'

class LinguiErrorTest extends React.Component {
  render() {
    return <div>:(</div>
  }
}

Using extract gives me:
image

The same error will happen on the babel plugin for some files (i'm not sure what is the trigger for the babel plugin).

tricoder42 added a commit that referenced this issue Aug 22, 2017
Ignore files without lingui imports
@tricoder42
Copy link
Contributor

Fixed in latest releases:

babel-plugin-lingui-extract-messages@1.0.5
babel-plugin-lingui-transform-react@1.0.4
babel-preset-lingui-react@1.0.3
lingui-cli@1.1.0

@felipeko
Copy link
Contributor Author

Working now, thanks!

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

No branches or pull requests

3 participants