smartlook / smartlook-mobile-issue-tracker

Official Smartlook issue tracker for mobile SDKs
4 stars 0 forks source link

Syntax error: Unexpected token (Typescript?) #144

Closed ivanseibel closed 2 years ago

ivanseibel commented 2 years ago

Platform Android/iOS

Technology React Native

Build instructions [optional]

{
  "name": "App",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "ios-device": "react-native run-ios --device \"Harvey iPhone 7\"",
    "ios": "react-native run-ios --simulator \"iPhone 13\"",
    "android": "react-native run-android",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "postinstall": "jetify",
    "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
  },
  "dependencies": {
    "@invertase/react-native-apple-authentication": "^1.1.2",
    "@react-native-community/cameraroll": "^1.7.2",
    "@react-native-community/geolocation": "^1.4.2",
    "@react-native-community/google-signin": "^4.0.3",
    "@react-native-community/viewpager": "^3.3.0",
    "adm-zip": "^0.4.13",
    "lodash": "^4.17.13",
    "moment": "^2.24.0",
    "plist": "^3.0.1",
    "prop-types": "^15.7.2",
    "react": "16.8.6",
    "react-native": "0.60.0",
    "react-native-actionsheet": "^2.4.2",
    "react-native-cached-image": "^1.4.3",
    "react-native-camera": "^3.19.0",
    "react-native-camera-kit": "^8.0.1",
    "react-native-check-app-install": "0.0.5",
    "react-native-device-info": "^5.6.1",
    "react-native-dialog": "^5.6.0",
    "react-native-elements": "^1.1.0",
    "react-native-fast-image": "^8.1.5",
    "react-native-fbsdk": "git+https://github.com/facebook/react-native-fbsdk.git",
    "react-native-firebase": "^5.6.0",
    "react-native-fs": "^2.14.1",
    "react-native-geolocation-service": "^3.1.0",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-image-pan-zoom": "^2.1.11",
    "react-native-image-picker": "^0.28.1",
    "react-native-img-cache": "^1.6.0",
    "react-native-keyboard-aware-scroll-view": "^0.8.0",
    "react-native-multiple-select": "^0.5.0",
    "react-native-orientation": "^3.1.3",
    "react-native-permissions": "^2.0.2",
    "react-native-sectioned-multi-select": "^0.7.0",
    "react-native-share": "^2.0.0",
    "react-native-swipe-navigation": "^1.0.0-beta",
    "react-native-swipeout": "^2.3.6",
    "react-native-vector-icons": "^6.6.0",
    "react-native-webview": "^8.0.0",
    "react-native-wheel-scroll-picker": "^0.2.4",
    "react-navigation": "^3.11.1",
    "react-redux": "^7.2.1",
    "redux": "^4.0.3",
    "redux-thunk": "^2.3.0",
    "rn-fetch-blob": "git+https://github.com/joltup/rn-fetch-blob",
    "smartlook-react-native-wrapper": "^1.2.5",
    "styled-components": "^5.0.1",
    "uglify-js": "^3.6.0",
    "xcode": "^2.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@babel/runtime": "^7.5.4",
    "babel-jest": "^24.5.0",
    "jest": "^24.5.0",
    "jetifier": "^1.6.2",
    "metro-react-native-babel-preset": "^0.53.1",
    "react-test-renderer": "16.8.6",
    "remote-redux-devtools": "^0.5.16"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts"
    ]
  }
}

Rendering [optional]

Affected devices [optional]

Smartlook SDK version From Podfile.lock

- Smartlook (1.8.6)
  - smartlook-react-native-bridge (1.2.5):
    - React
    - Smartlook (~> 1.8.3)

Summary After launching successfully the app on the emulator the app crashes with a weird syntax error. We were using an older version before (0.26.0) and we didn't have this problem, but we had to update the version because recently the app wasn't building anymore.

Steps to reproduce [optional] yarn ios

Example Project [optional]

Relevant logs and/or screenshots

krystofcelba commented 2 years ago

Hi @ivanseibel, Thanks for your bug report! To resolve the issue I would like to ask how do you import Smartlook in your js files?

ivanseibel commented 2 years ago

Sorry for my late response :)

export const smartlook = require('smartlook-react-native-wrapper');

krystofcelba commented 2 years ago

Hey @ivanseibel, could you please change it to import Smartlook from 'smartlook-react-native-wrapper';? Hopefully, it'll help.