solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.02k stars 4.19k forks source link

React-native build fails when generating the dsym file #27251

Closed adilmezghouti closed 2 years ago

adilmezghouti commented 2 years ago

Problem

The react-native build fails during the minification step. Note that the build used to work fine with version 1.47.3. Here is the error I am getting: error node_modules/@solana/web3.js/lib/index.native.js: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4138:32. Error: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4138:32 at minifyCode (/Users/username/development/projectName/node_modules/metro-transform-worker/src/index.js:101:13) at transformJS (/Users/username/development/projectName/node_modules/metro-transform-worker/src/index.js:319:28) at transformJSWithBabel (/Users/username/development/projectName/Mobile/node_modules/metro-transform-worker/src/index.js:410:16) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (/Users/username/development/projectName/Mobile/node_modules/metro-transform-worker/src/index.js:571:12)

Environment information:

lichmac commented 2 years ago

Hi Any update? I am having this same issue

mr-574rk commented 2 years ago

im having same issue , any solution yet?

adilmezghouti commented 2 years ago

Updating metro.config.js to configure the metro transformer to use the terser minifier worked for me. You can do so by adding this to the transformer section: minifierPath: 'metro-minify-terser', To make this work, you need to yarn or npm install metro-minify-terser as well.

adamkoot commented 2 years ago

Updating metro.config.js to configure the metro transformer to use the terser minifier worked for me. You can do so by adding this to the transformer section: minifierPath: 'metro-minify-terser', To make this work, you need to yarn or npm install metro-minify-terser as well.

It's works for me, thanks!