Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Problem with Node.js v12.0.0 REPL? #792

Closed
chrisveness opened this issue Apr 29, 2019 · 3 comments
Closed

Problem with Node.js v12.0.0 REPL? #792

chrisveness opened this issue Apr 29, 2019 · 3 comments
Labels

Comments

@chrisveness
Copy link

Has Node.js v12.0.0 broken something to do with using esm in the REPL?

$ npm install geodesy esm
$ nvm use 11.14.0
Now using node v11.14.0 (npm v6.7.0)
$ node -r esm
> import LatLon from 'geodesy/latlon-spherical';
undefined
> d = new LatLon(52, 0).distanceTo(new LatLon(48, 2));
467138.7758206903
>
$ 
$ nvm use 12.0.0
Now using node v12.0.0 (npm v6.9.0)
$ node -r esm
Welcome to Node.js v12.0.0.
Type ".help" for more information.
> import LatLon from 'geodesy/latlon-spherical';
Thrown:
TypeError: Cannot read property 'exports' of undefined
    at repl:1
    at repl:1
    at Script.runInThisContext (vm.js:123:20)
    at REPLServer.defaultEval (repl.js:358:29)
    at bound (domain.js:415:14)
    at REPLServer.runBound [as eval] (domain.js:428:12)
    at REPLServer.onLine (repl.js:665:10)
> 
$ 

Or is there something we should be doing differently now?

(This is with esm v3.2.22).

@willxy
Copy link

willxy commented Apr 29, 2019

I'm getting this error as well, from importing at the REPL with 12.0.0 and 12.1.0.

@jdalton
Copy link
Member

jdalton commented Apr 30, 2019

Yep. No need for others to confirm.
I've been meaning to move to a more thorough hook for the REPL.

I'm guessing it's time :)

@jdalton jdalton added the bug label May 2, 2019
@boneskull
Copy link

tests are also failing in Node.js v12 because there's no binary for sleep available (darwin)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

4 participants