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

Error: Unbound variable `performance.timeOrigin' #207

Closed
felipelalli opened this issue Jan 3, 2022 · 7 comments
Closed

Error: Unbound variable `performance.timeOrigin' #207

felipelalli opened this issue Jan 3, 2022 · 7 comments
Labels
bug Something isn't working resolved

Comments

@felipelalli
Copy link

Error: Unbound variable `performance.timeOrigin'
    at Environment.get (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:6751:15)
    at evaluate (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:9907:24)
    at resolve (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:7416:24)
    at unpromise (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:1707:12)
    at Environment.<anonymous> (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:7433:16)
    at Macro.invoke (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:3287:30)
    at evaluate_macro (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:9806:23)
    at evaluate (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:9937:22)
    at loop (file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:9763:23)
    at file:///usr/local/lib/node_modules/@jcubic/lips/src/lips.js:9778:24
[1]: performance.timeOrigin
[2]: (if (eq? self window)
         performance.timing.navigationStart performance.timeOrigin)
[3]: (* 1000 (if (eq? self window)
                 performance.timing.navigationStart performance.timeOrigin))
[4]: (truncate (* 1000 (if (eq? self window)
                           performance.timing.navigationStart performance.timeOrigin)))
[5]: (define %%start-jiffy (truncate (* 1000 (if (eq? self window)
                                                 performance.timing.navigationStart performance.timeOrigin))) "Constant value that indicates start jiffy of the scheme process.")
@jcubic
Copy link
Collaborator

jcubic commented Jan 3, 2022

Where do you see this? Browser or Node and what version what OS?

@jcubic
Copy link
Collaborator

jcubic commented Jan 3, 2022

I think that I need to add a fallback when performance API is missing.

https://caniuse.com/mdn-api_performance_timeorigin

@felipelalli
Copy link
Author

Debian 11 / Nodejs, after the command
sudo npm install -g @jcubic/lips@beta

@jcubic
Copy link
Collaborator

jcubic commented Jan 4, 2022

I think you have very old nodeJS, Debian is known to have outdated packages. What version of Node do you have?

@felipelalli
Copy link
Author

v12.22.5

@jcubic
Copy link
Collaborator

jcubic commented Jan 5, 2022

I think that before Node 14 you need to import performance from 'perf_hooks' module. It also works for Node 14.

So I need to add:

(define performance (. (require "perf_hooks") "performance"))

into R7RS.scm file.

Before the fix, you can try to update Node, just install nvm, which can be used to update Node.

I was wondering if you can fix it somehow with the current version. You can change how the standard library is loaded with --bootstrap, but there may be a problem with finding the library, becasue LIPS search it's own node directory for std lib.

@jcubic jcubic added the bug Something isn't working label Jan 5, 2022
@jcubic
Copy link
Collaborator

jcubic commented Jan 6, 2022

Oh, it seems that I've already fixed this issue in 1c3be12

But there are only 2 bug fixes so it was not released as new beta version.

@jcubic jcubic added the resolved label Jan 6, 2022
@jcubic jcubic closed this as completed Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

2 participants