lukehaas/RunJS

Cannot import bundled package with alias `* as alias`

Closed this issue · 4 comments

I've been getting this issue for about a month. Even with bundling enabled in my RunJS settings, I get the error below when importing * as alias.

TypeError: Cannot set property top of #<Window> which has only a getter

For example:

import * as d3 from 'd3'

d3.format(".2s")(42e6)


Debug log

{ "version": "2.11.0", "platform": "darwin", "arch": "arm64", "activated": true, "logs": [ { "path": "/Users/brandonmcconnell/Library/Logs/runjs/main.log", "lines": [ "[2024-03-18 22:43:08.335] [error] Unhandled TypeError: Cannot read properties of undefined (reading 'libraryDefaultDir')", " at Function.resolvePathFn (/Applications/RunJS.app/Contents/Resources/app.asar/entry-bundle.js:14:97807)", " at Function.readAllLogs (/Applications/RunJS.app/Contents/Resources/app.asar/entry-bundle.js:14:97314)", " at click (/Applications/RunJS.app/Contents/Resources/app.asar/entry-bundle.js:8:90678)", " at MenuItem.click (node:electron/js2c/browser_init:2:29559)", " at a._executeCommand (node:electron/js2c/browser_init:2:34987)", "" ] } ] }

@brandonmcconnell thanks for raising this.
It looks like you can resolve this problem by disabling transpilation.
I'm not certain why that is at the moment but I'll have a closer look soon.

@brandonmcconnell this looks like it's working now in the latest release. Version 2.12.0.

Thanks!

I'll close this for now and open a new one if I encounter the same issue, or one similar, again.