Skip to main content
Code formatting.
Source Link
steveluscher
  • 3.2k
  • 8
  • 38

I created a new react-native project using

npx react-native init AwesomeTSProject --template react-native-template-typescript

npx react-native init AwesomeTSProject --template react-native-template-typescript

Then I followed the steps metioned in the following url to install @solana/web3.js package https://solanacookbook.com/integrations/react-native.html#create-a-new-app

Then I gave this command to generate the build

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

I am getting this error

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 4276:32. Error: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4276:32 at minifyCode (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:99:13) at transformJS (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:317:28) at transformJSWithBabel (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:408:16) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:569:12)

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 4276:32.
Error: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4276:32
    at minifyCode (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:99:13)
    at transformJS (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:317:28)
    at transformJSWithBabel (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:408:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.transform (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:569:12)

Can anyone help me out??

I created a new react-native project using

npx react-native init AwesomeTSProject --template react-native-template-typescript

Then I followed the steps metioned in the following url to install @solana/web3.js package https://solanacookbook.com/integrations/react-native.html#create-a-new-app

Then I gave this command to generate the build

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

I am getting this error

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 4276:32. Error: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4276:32 at minifyCode (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:99:13) at transformJS (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:317:28) at transformJSWithBabel (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:408:16) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:569:12)

Can anyone help me out??

I created a new react-native project using

npx react-native init AwesomeTSProject --template react-native-template-typescript

Then I followed the steps metioned in the following url to install @solana/web3.js package https://solanacookbook.com/integrations/react-native.html#create-a-new-app

Then I gave this command to generate the build

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

I am getting this error

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 4276:32.
Error: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4276:32
    at minifyCode (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:99:13)
    at transformJS (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:317:28)
    at transformJSWithBabel (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:408:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.transform (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:569:12)

Can anyone help me out??

Source Link

Error while generating a build in react native using @solana/web3.js

I created a new react-native project using

npx react-native init AwesomeTSProject --template react-native-template-typescript

Then I followed the steps metioned in the following url to install @solana/web3.js package https://solanacookbook.com/integrations/react-native.html#create-a-new-app

Then I gave this command to generate the build

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

I am getting this error

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 4276:32. Error: Unexpected token name «n», expected punc «,» in file node_modules/@solana/web3.js/lib/index.native.js at 4276:32 at minifyCode (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:99:13) at transformJS (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:317:28) at transformJSWithBabel (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:408:16) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.transform (/Users/username/Workspace/sampleproj/node_modules/metro-transform-worker/src/index.js:569:12)

Can anyone help me out??