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

Versions after 2.2.1 deletes translation files content #55

Closed
Mi5i opened this issue Oct 25, 2019 · 3 comments
Closed

Versions after 2.2.1 deletes translation files content #55

Mi5i opened this issue Oct 25, 2019 · 3 comments

Comments

@Mi5i
Copy link

Mi5i commented Oct 25, 2019

Tested with two versions:

  • node 10.x and 12.13.0:
  • npm 6.11.13 and 6.12.0:

The v2.3.0 - v2.3.3 all versions delete translation files content.

Instead of en fills with the extracted messages and other languages are with key and "" value pairs, all translation files content filled only "{}"

Simple test: as in the example shows.

Package json:

"dependencies": {
    "@giantmachines/redux-websocket": "^1.1.3",
    "babel-plugin-react-intl": "^4.1.21",
    "classnames": "^2.2.6",
    "connected-react-router": "^6.5.2",
    "history": "^4.9.0",
    "react": "^16.8.6",
    "react-css-modules": "^4.7.11",
    "react-dates": "^20.3.0",
    "react-dom": "^16.8.6",
    "react-intl": "^2.9.0",
    "react-intl-translations-manager": "^5.0.3",
    "react-redux": "^7.1.0",
    "react-router-dom": "^5.0.1",
    "react-router-redux": "^4.0.8",
    "react-scripts": "3.0.1",
    "react-toastify": "^5.3.2",
    "recharts": "^1.7.1",
    "redux": "^4.0.4",
    "redux-form": "^8.2.5",
    "redux-logger": "^3.0.6",
    "redux-orm": "^0.13.3",
    "redux-thunk": "^2.3.0",
    "ws": "^7.1.2"
  },

  "devDependencies": {
    "@babel/core": "^7.5.5",
    "@babel/preset-env": "^7.5.5",
    "@babel/preset-react": "^7.0.0",
    "@types/react-intl": "^3.0.0",
    "babel-loader": "^8.0.6",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "css-loader": "^3.1.0",
    "extract-react-intl-messages": "^2.3.3",
    "file-loader": "^4.2.0",
    "html-loader": "^0.5.5",
    "html-webpack-plugin": "^3.2.0",
    "node-sass": "^4.12.0",
    "path": "^0.12.7",
    "postcss-loader": "^3.0.0",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "svg-inline-loader": "^0.8.0",
    "svg-inline-react": "^3.1.0",
    "uglifyjs-webpack-plugin": "^2.1.3",
    "webpack": "^4.37.0",
    "webpack-cli": "^3.3.6",
    "webpack-dev-server": "^3.7.2",
    "webpack-merge": "^4.2.1"
  }
@lensbart
Copy link
Contributor

lensbart commented Jan 15, 2020

Hello @Mi5i, @Lpaydat and @zarv1k (mentioning because you liked the issue above)

Please try the following

  1. upgrading to the latest 2.3.5
  2. including react-intl in your babel config like so:
['react-intl-auto', { removePrefix: 'app/' }],
[
  'react-intl',
  {
    extractFromFormatMessageCall: true,
    messagesDir: 'build/extract-messages'
  }
]
  1. commenting out lines 74-86 in node_modules/extract-react-intl-messages/dist/extract-react-intl/index.js as a temporary fix to this issue:
    // presets.unshift({
    //     plugins: [
    //         [
    //             babel_plugin_react_intl_1.default,
    //             Object.entries(pluginOptions).reduce((acc, [key, value]) => {
    //                 if (babelPluginReactIntlOptions.includes(key)) {
    //                     return Object.assign(Object.assign({}, acc), { [key]: value });
    //                 }
    //                 return acc;
    //             }, {})
    //         ]
    //     ]
    // });

See #64

Hope this helps

@lensbart
Copy link
Contributor

For convenience, you can try with @nextbook/extract-react-intl-messages until a fix is issued. This way, the dependency doesn’t get reset when upgrading others.

@akameco
Copy link
Owner

akameco commented Mar 24, 2020

Fixed. Please use the latest version.

@akameco akameco closed this as completed Mar 24, 2020
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