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: a is not a function #140

Closed
nicholaschiang opened this issue Jun 2, 2021 · 6 comments
Closed

BUG: a is not a function #140

nicholaschiang opened this issue Jun 2, 2021 · 6 comments

Comments

@nicholaschiang
Copy link

nicholaschiang commented Jun 2, 2021

Describe the bug:

My Next.js app doesn't compile. Instead, it gives me this error:

TypeError: a is not a function
    at https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:293835
    at https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:34190
    at Object.eval (/home/projects/github-wpszkt/node_modules/jose/lib/registry/ec_curves.js:5:5)
    at Object.function (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:11:15383)
    at Module._compile (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:187553)
    at Object.Module._extensions..js (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:187912)
    at Module.load (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:185992)
    at Function.Module._load (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:183568)
    at Module.require (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:186308)
    at i (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:484683)
    at _0x2d4ef9 (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:11:15298)
    at Object.eval (/home/projects/github-wpszkt/node_modules/jose/lib/registry/index.js:1:80)
    at Object.function (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:11:15383)
    at Module._compile (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:187553)
    at Object.Module._extensions..js (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:187912)
    at Module.load (https://github-wpszkt.jw.staticblitz.com/blitz.12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08.js:6:185992)

Which is then shown in the development server:

image

Link to the blitz that caused the error
https://stackblitz.com/edit/tutorbook

Steps to reproduce:

  1. Open https://stackblitz.com/edit/tutorbook.
  2. Wait for the web container to boot, deps to install, and dev server to start.
  3. See error.

Expected behavior:

There should no error.

Version of webcontainer:
Hash: 12423d4ada17c5bf9dcd8d2c2bd877a5f9b12d08

Desktop (please complete the following information):
Browser name = Chrome
Full version = 90.0.4430.218
Major version = 90
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (X11; CrOS x86_64 13816.82.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.218 Safari/537.36
performance.memory = {
"totalJSHeapSize": 170309605,
"usedJSHeapSize": 160609069,
"jsHeapSizeLimit": 2172649472
}

Additional context:

I'm trying to get Tutorbook working in StackBlitz.

@nicholaschiang nicholaschiang changed the title BUG: BUG: a is not a function Jun 2, 2021
@SamVerschueren
Copy link
Contributor

Hi @nicholaschiang! Thanks for reporting. This looks like an issue on our end. Could you create a new Blitz and update the URLs? It looks like you removed the project so would be great if I had a direct URL 🙏 .

@SamVerschueren SamVerschueren added bug Something isn't working core labels Jun 2, 2021
@nicholaschiang
Copy link
Author

@SamVerschueren I've updated the original issue with the renamed https://stackblitz.com/edit/tutorbook.

Or, if you can't access that, you should be able to fork https://stackblitz.com/github/tutorbookapp/tutorbook but you'll need some .env.local files (see stackblitz/core#1492).

@ndom91
Copy link

ndom91 commented Jun 5, 2021

I'm having the same issue with a private backend hapi api. Seems to be a jose elliptic curve issue.

Let me know if I can help in any way either!

In my case, system details are:

Browser name = Chromium
Full version = 89.0.4389.90 (Developer Build 62eb262cdaae9ef819aadd778193781455ec7a49-refs/branch-heads/4389@{#1534} Linux) Arch Linux
Major version = 89
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 171598490,
  "usedJSHeapSize": 164806034,
  "jsHeapSizeLimit": 4294705152
}

EDIT: Seems to be the getCurves fn from nodes crypto module. See:

panva/jose#72
panva/jose#93

Also apparently jose > 3.0 is a universal module that should work natively in the browser though, will give this a try. (mine was trying to use 2.0.3)

@SamVerschueren
Copy link
Contributor

Everything crypto related is currently kinda wonky. Not everything works yet as we focussed heavily on front-end tooling first. It’s something we’re working on though but can’t give you an exact timing.

@d3lm
Copy link

d3lm commented Feb 22, 2023

Hey! While getCurves is not yet implemented, it doesn't throw anymore and you'll get an empty array instead. But I can't run the project cause I am getting UNAVAILABLE: No connection established. May be related to some environment variables being incorrect that it can't connect to the Firebase DB?

I think if we want to revisit this, we'll need more info.

@d3lm d3lm added needs more info and removed bug Something isn't working core tracked labels Feb 22, 2023
@jrvidal
Copy link
Contributor

jrvidal commented Oct 17, 2023

👋 We're closing this due to inactivity. Please, feel free to open a new one if you're still encountering any errors.

@jrvidal jrvidal closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants