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

[babel-plugin-fbt] in conflict with "react-hot-loader/babel" : TypeError: Property value expected type of string but got null #65

Closed
retyui opened this issue May 30, 2019 · 1 comment

Comments

@retyui
Copy link
Contributor

retyui commented May 30, 2019

When I run next command:

node ../node_modules/babel-plugin-fbt/bin/collectFBT.js --pretty  --json-input  < i18n/src-manifest.json

I get an error:

src/features/usersPage/Page/index.js:
	TypeError: Property value expected type of string but got null

/home/i/all-work/synergeto/admin-ui/node_modules/babel-plugin-fbt/bin/collectFBT.js:131
    throw new Error(`Failed in ${errCount} files`);
    ^

Error: Failed in 4 files
    at writeOutput (/home/i/all-work/synergeto/admin-ui/node_modules/babel-plugin-fbt/bin/collectFBT.js:131:11)
    at ReadStream.<anonymous> (/home/i/all-work/synergeto/admin-ui/node_modules/babel-plugin-fbt/bin/collectFBT.js:169:5)
    at ReadStream.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

A babel config to fix this problem:

const fbtEnumManifest = require('./.i18n/enum-manifest.json');

const presets = ['@exeto/babel-preset-react'];
const plugins = [
  ['babel-plugin-fbt', { fbtEnumManifest }],
  'babel-plugin-fbt-runtime',
];

// To fix problem with Fbt
+if (process.env.NODE_ENV === 'development') {
+  plugins.push('react-hot-loader/babel');
+}

module.exports = {
  presets,
  plugins,
};
@jrwats
Copy link
Contributor

jrwats commented Jun 6, 2019

@retyui, I think I'm going to have to know more to understand what's wrong and if this is specific to your setup or of others could hit this. Is this source Github or shared anywhere?

@retyui retyui closed this as completed Aug 6, 2019
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

2 participants