TypeError: Cannot read property 'transformFile' of undefined
See original GitHub issueVersions:
“react-native”: “0.59.10”, “react-native-obfuscating-transformer”: “^1.0.0”,
Files:
metro.config.js:
module.exports = {
transformer: {
babelTransformerPath: require.resolve("./transformer"),
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
transformer.js:
const obfuscatingTransformer = require('react-native-obfuscating-transformer')
module.exports = obfuscatingTransformer({})
Error I am getting:
Loading dependency graph, done.
Loading dependency graph...error Cannot read property 'transformFile' of undefined
debug TypeError: Cannot read property 'transformFile' of undefined
at /home/chris/Documents/JSObfuscation/ObfuscationTest/node_modules/metro/src/Bundler.js:83:34
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/chris/Documents/JSObfuscation/ObfuscationTest/node_modules/metro/src/Bundler.js:14:24)
at _next (/home/chris/Documents/JSObfuscation/ObfuscationTest/node_modules/metro/src/Bundler.js:34:9)
Repo
Simplest repo I could make that reproduces this error:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
error: bundling failed: TypeError: Cannot read property ...
This is an old thread but I wanted to contribute as it is one of the first threads that appears in Google when...
Read more >Cannot read properties of undefined (reading 'transformFile')
To solve the TypeError: Cannot read properties of undefined (reading 'transformFile'), update your `react-native` version to the latest.
Read more >error: bundling failed: TypeError: Cannot read property ...
I got this error when trying to build my react native app after doing installs of node and npm. My machine was running...
Read more >Error referencing code I can't find? Bundler.js - Reddit
Metro has encountered an error: Cannot read properties of undefined (reading 'transformFile'): /Users/[my name]/Desktop/[project ...
Read more >failed to construct transformer react native - You.com
Metro has encountered an error: Cannot read property 'transformFile' of undefined: Web/Rayrok/apps/the-bible/node_modules/metro/src/Bundler.js (95:34) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I find the solution when using with react-native 0.61 This is my metro.config.js My problem disappear when I change babelTransformerPath: require.resolve(“./transformer”) to getTransformModulePath: () => { return require.resolve(‘./transformer’); },
npm i babylon --save-dev