Title: Unable to import babel-plugins/presets in production for transform
Tags: reactjs;meteor;babeljs
Question: I am using babel in production to transform jsx strings into html, for the purpose of rendering email bodies via string templates.

```import {transform} from '@babel/core';
const {code} = transform(template, {plugins: ['@babel/plugin-transform-react-jsx']});
```

I have ```@babel/core``` and ```@babel/plugin-transform-react-jsx``` in my dependencies. The code works on development but on production it fails saying, 'Can not find module ```@babel/plugin-transform-react-jsx```'. Can someone help me debug/understand the underlying issue here?

I tried adding a deliberate ```import '@babel/plugin-transform-react-jsx';``` but to no avail.

Sample code for the same: https://codesandbox.io/s/cool-euler-v21z3

Can it be a deployment issue? The complete error logs:

```Exception while invoking method 'template.getComponentFunctions' Error: Cannot find module '@babel/plugin-transform-react-jsx' from '/built_app/programs/server'
316-762-1581]    at Function.module.exports [as sync] (/built_app/programs/server/npm/node_modules/resolve/lib/sync.js:58:15)
316-762-1581]    at resolveStandardizedName (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/files/plugins.js:101:31)
316-762-1581]    at resolvePlugin (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/files/plugins.js:54:10)
316-762-1581]    at loadPlugin (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/files/plugins.js:62:20)
316-762-1581]    at createDescriptor (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
316-762-1581]    at /built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
316-762-1581]    at Array.map (<anonymous&gt;)
316-762-1581]    at createDescriptors (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
316-762-1581]    at createPluginDescriptors (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
316-762-1581]    at /built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-descriptors.js:63:53
316-762-1581]    at cachedFunction (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/caching.js:62:27)
316-762-1581]    at cachedFunction.next (<anonymous&gt;)
316-762-1581]    at evaluateSync (/built_app/programs/server/npm/node_modules/gensync/index.js:244:28)
316-762-1581]    at sync (/built_app/programs/server/npm/node_modules/gensync/index.js:84:14)
316-762-1581]    at plugins (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
316-762-1581]    at mergeChainOpts (/built_app/programs/server/npm/node_modules/@babel/core/lib/config/config-chain.js:319:26)
```



Here is another answer: While I was unable to figure out the reason and solve it properly, I was able to work around by using ```@babel/standalone```.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:04/01/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<reactjs><meteor><babeljs>', 'Title': 'Unable to import babel-plugins/presets in production for transform', 'ViewCount': 87, 'id': 60970755, 'user_AboutMe': None, 'user_AccountId': 1674374.0, 'user_DisplayName': 'Sudhanshu', 'user_Reputation': 450.0, 'user_Views': 32.0, 'user_id': 1714046.0}}