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

[BUG]: ReferenceError: Property 'atob' doesn't exist #458

Closed
1 task done
iChristosK opened this issue Mar 16, 2023 · 9 comments
Closed
1 task done

[BUG]: ReferenceError: Property 'atob' doesn't exist #458

iChristosK opened this issue Mar 16, 2023 · 9 comments
Labels
Type: Bug Something isn't working as documented, or is being fixed

Comments

@iChristosK
Copy link

What happened?

I have the following code:

 const { createAppAuth } = require("@octokit/auth-app");
    const auth = createAppAuth({
      appId: GITHUB_APP_ID,
      privateKey: GITHUB_APP_PRIVATE_KEY,
      clientId: authGithubConfig.clientId,
      clientSecret: authGithubConfig.clientSecret,
    });

    // Retrieve JSON Web Token (JWT) to authenticate as app
    const appAuthentication = await auth({ type: "app" });

I get error:

Possible Unhandled Promise Rejection (id: 0):
ReferenceError: Property 'atob' doesn't exist

Versions

Node v16.13.0,
"@octokit/auth-app": "^4.0.9",
"@octokit/core": "^4.2.0",
"react-native": "0.71.2",
"typescript": "4.8.4"

Relevant log output

Possible Unhandled Promise Rejection (id: 0):
ReferenceError: Property 'atob' doesn't exist
ReferenceError: Property 'atob' doesn't exist
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120671:64)
    at next (native)
    at t (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120626:19)
    at u (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120640:12)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120645:10)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120637:25)
    at apply (native)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120687:21)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120709:23)
    at next (native)
    at t (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120626:19)
    at u (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120640:12)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120645:10)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120637:25)
    at apply (native)
    at u (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120714:14)
    at apply (native)
    at o (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:120691:19)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:119541:110)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20416:26)
    at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20435:29)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20440:14)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20432:25)
    at apply (native)
    at _getAppAuthentication (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:119560:39)
    at apply (native)
    at getAppAuthentication (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:119533:39)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:119768:38)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20416:26)
    at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20435:29)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20440:14)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20432:25)
    at apply (native)
    at _auth (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:119785:23)
    at apply (native)
    at auth (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:119762:23)
    at ?anon_0_ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:117121:43)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20416:26)
    at _next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20435:29)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20440:14)
    at tryCallTwo (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:61:9)
    at doResolve (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:216:25)
    at Promise (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:82:14)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:20432:25)
    at apply (native)
    at signWithOctoKit (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:117127:27)
    at onPress (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:117189:35)
    at _performTransitionSideEffects (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:50784:22)
    at _receiveSignal (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:50740:45)
    at onResponderRelease (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:50607:34)
    at apply (native)
    at invokeGuardedCallbackProd (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:62547:21)
    at apply (native)
    at invokeGuardedCallback (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:62633:42)
    at apply (native)
    at invokeGuardedCallbackAndCatchFirstError (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:62636:36)
    at executeDispatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:62700:48)
    at executeDispatchesInOrder (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:62717:26)
    at executeDispatchesAndRelease (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63823:35)
    at executeDispatchesAndReleaseTopLevel (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63830:43)
    at forEach (native)
    at forEachAccumulated (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63159:22)
    at runEventsInBatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63841:27)
    at runExtractedPluginEventsInBatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63900:25)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63881:42)
    at batchedUpdates$1 (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:74471:20)
    at batchedUpdates (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63812:36)
    at _receiveRootNodeIDEvent (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63880:23)
    at receiveTouches (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:63923:34)
    at apply (native)
    at __callFunction (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:2443:36)
    at anonymous (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:2204:31)
    at __guard (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:2394:15)
    at callFunctionReturnFlushedQueue (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.commitsApp:2203:21)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@iChristosK iChristosK added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented, or is being fixed labels Mar 16, 2023
@wolfy1339
Copy link
Member

There was a case similar to this one, octokit/plugin-create-or-update-text-file.js#15

That plugin isn't used anywhere in this repository though, and it's the only mention of atob in the Octokit organization

Can you rebuild your project with source maps enabled and in dev mode? That traceback doesn't contain any useful info for debugging

@wolfy1339 wolfy1339 added the Status: Needs info Full requirements are not yet known, so implementation should not be started label Mar 16, 2023
@wolfy1339
Copy link
Member

Can you see if the solutions raised in #59 work for you?

@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🛑 Blocked/Awaiting Response in 🧰 Octokit Active Mar 16, 2023
@iChristosK
Copy link
Author

iChristosK commented Mar 17, 2023

Can you see if the solutions raised in #59 work for you?

I've read #59, but it's unclear to me if they provide any solutions. Could you please clarify a clear solution?

@wolfy1339
Copy link
Member

Can you try editing your webpack config to change the resolve behaviour?
webpack/webpack#5756 (comment)

@iChristosK
Copy link
Author

module.exports = {
  resolve: {mainFields: ['main', 'module']}, // I added this
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
    }),
  },
};

I have added the above line, inside metro.config.js as I am developing in app in react native and there's no webpack by default, only metro.config.js.
But it still shows the same error

Possible Unhandled Promise Rejection (id: 0):
ReferenceError: Property 'atob' doesn't exist

@wolfy1339
Copy link
Member

Sorry, I have only use React with webpack, and not react native.
I've found the equivalent in the metro docs:
https://facebook.github.io/metro/docs/configuration/#resolvermainfields

@iChristosK
Copy link
Author

I have read the documentation for react native metro.config.js and I have updated my answer to:

resolver: {
    resolverMainFields: ['main', 'module'],
  },

Unfortunately this solution caused other dependencies to break because they want module instead of main.


Error: Unable to resolve module stream from /Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/node-fetch/lib/index.js: stream could not be found within the project or in these directories:
  node_modules
   5 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
   6 |
>  7 | var Stream = _interopDefault(require('stream'));
     |                                       ^
   8 | var http = _interopDefault(require('http'));
   9 | var Url = _interopDefault(require('url'));
  10 | var whatwgUrl = _interopDefault(require('whatwg-url'));
    at ModuleResolver.resolveDependency (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:162:15)
    at DependencyGraph.resolveDependency (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/node-haste/DependencyGraph.js:260:43)
    at Object.resolve (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/lib/transformHelpers.js:177:21)
    at Graph._resolveDependencies (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/DeltaBundler/Graph.js:432:35)
    at Graph._processModule (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/DeltaBundler/Graph.js:218:38)
    at async Graph._addDependency (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/DeltaBundler/Graph.js:314:20)
    at async Promise.all (index 0)
    at async Graph._processModule (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/DeltaBundler/Graph.js:263:5)
    at async Graph._addDependency (/Users/christos/Developer/Mobile/RN/commits/commitsApp/node_modules/metro/src/DeltaBundler/Graph.js:314:20)
    at async Promise.all (index 7)

@wolfy1339 wolfy1339 removed Status: Needs info Full requirements are not yet known, so implementation should not be started Status: Triage This is being looked at and prioritized labels Mar 27, 2023
@wolfy1339
Copy link
Member

I am not sure there is anything we can do at the moment.

@iChristosK
Copy link
Author

Alright. I guess I'll pivot.

@github-project-automation github-project-automation bot moved this from 🛑 Blocked/Awaiting Response to ✅ Done in 🧰 Octokit Active Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented, or is being fixed
Projects
Archived in project
Development

No branches or pull requests

2 participants