Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected identifier "AdaptyAccessLevelCoder" #48

Closed
rafakwolf opened this issue Feb 14, 2023 · 12 comments
Closed

Unexpected identifier "AdaptyAccessLevelCoder" #48

rafakwolf opened this issue Feb 14, 2023 · 12 comments
Assignees

Comments

@rafakwolf
Copy link

Hi, after installing the version 2.3.2, the issue #47 was solved, thank you. However, I'm facing a different error now

here's my environment info:

  EAS CLI 3.5.2 environment info:
    System:
      OS: Linux 6.0 Pop!_OS 22.04 LTS
      Shell: 5.8.1 - /usr/bin/zsh
    Binaries:
      Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 9.4.2 - ~/.nvm/versions/node/v16.19.0/bin/npm
    Utilities:
      Git: 2.34.1 - /usr/bin/git
    npmPackages:
      @expo/webpack-config: ^0.17.4 => 0.17.4 
      expo: ^47.0.13 => 47.0.13 
      expo-updates: ~0.15.6 => 0.15.6 
      react: 18.1.0 => 18.1.0 
      react-dom: 18.1.0 => 18.1.0 
      react-native: 0.70.5 => 0.70.5 
      react-native-web: ^0.18.12 => 0.18.12 
    npmGlobalPackages:
      eas-cli: 3.5.2
    Project workflow: generic

My code:

        await adapty.activate(AdaptyApiKey);

        AdaptyError.onError = error => {
            console.error(error);
        };

        const profile = await adapty.getProfile(); // not even getting to here

        console.log(profile);

        const isSubscribed = profile?.accessLevels?.premium?.isActive;

Adapty dashboard access levels

image

Error:

{"error": [SyntaxError: JSON Parse error: Unexpected identifier "AdaptyAccessLevelCoder"]}

Thank you!

@divanc divanc self-assigned this Feb 16, 2023
@divanc
Copy link
Collaborator

divanc commented Feb 16, 2023

Can you provide a little more info — for example, if you just leave activate would it still be thrown? If you can create a minimal reproducible example it would be even better

@rafakwolf
Copy link
Author

Hey, yes, actually it's in the activate call that it's failing.
I'll try to create a reproducible example.

@divanc
Copy link
Collaborator

divanc commented Feb 16, 2023

And why your npmPackages does not list react-native-adapty?

@rafakwolf
Copy link
Author

I don't know, actually, I have many more other packages, I think it's an EAS thing, only listing the packages they care about or something like that. Anyway, here are the dependencies

"dependencies": {
"@react-navigation/drawer": "^6.5.7",
"@react-navigation/native": "^6.1.2",
"expo": "^47.0.13",
"expo-auth-session": "~3.8.0",
"expo-background-fetch": "~11.0.1",
"expo-constants": "~14.0.2",
"expo-device": "~5.0.0",
"expo-linear-gradient": "~12.0.1",
"expo-notifications": "~0.17.0",
"expo-random": "~13.0.0",
"expo-splash-screen": "~0.17.5",
"expo-sqlite": "~11.0.0",
"expo-status-bar": "~1.4.2",
"expo-system-ui": "~2.0.1",
"expo-task-manager": "~11.0.1",
"expo-updates": "~0.15.6",
"moti": "^0.22.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.5",
"react-native-adapty": "2.3.2",
"react-native-gesture-handler": "~2.8.0",
"react-native-google-mobile-ads": "^8.2.2",
"react-native-progress": "^5.0.0",
"react-native-reanimated": "~2.12.0",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "3.18.2",
"react-native-svg": "13.4.0",
"react-native-vector-icons": "^9.2.0",
"react-native-web": "^0.18.12",
"rollbar-react-native": "^0.9.3",
"valtio": "^1.9.0",
"@react-native-async-storage/async-storage": "~1.17.3"
},
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@expo/webpack-config": "^0.17.4",
"@jest/globals": "^29.3.1",
"@types/react": "~18.0.24",
"jest": "^29.3.1"
},

@rafakwolf
Copy link
Author

rafakwolf commented Feb 17, 2023

I'm not managing to reproduce it with an empty expo boilerplate, it looks like a conflict with some other package.
Trying to figure out which one is.

For now I'll stay on the version 1.4.1.

@divanc
Copy link
Collaborator

divanc commented Feb 18, 2023

Being an EAS log, does it mean it comes during Expo building? Does it come during local development?

@divanc
Copy link
Collaborator

divanc commented Feb 18, 2023

I would say, that it is unlikely that this is a code problem. My current bet is bundler not understanding the way things are.

If you experienced same problem during development, let's try simple steps:

  1. Remove node modules
  2. Preferably remove .lock file
  3. Remove adapty from package.json
  4. Install adapty via Expo CLI expo install react-native-adapty to assure compatibility
  5. expo start -c to clean bundler caches

@divanc
Copy link
Collaborator

divanc commented Feb 21, 2023

@rafakwolf can you try the thing above? Or have you found another solution?

@rafakwolf
Copy link
Author

@divanc yes, I'll try it and let you know the outcome

@rafakwolf
Copy link
Author

@divanc unfortunately, no success, same error :(

@divanc
Copy link
Collaborator

divanc commented Mar 27, 2023

Sorry for being absent on this issue for a while.
Can you check with the latest version? Also with logLevel verbose if persists. It is a strange kind of errror, I was unable to get that...

@divanc
Copy link
Collaborator

divanc commented Apr 24, 2023

I'm going to close this issue for now due to inactivity. If you need to come back to this issue, then re-open without a doubt

@divanc divanc closed this as completed Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants