0

Getting the error below trying to build maplibre on my Windows box. Followed the CONTRIBUTING.md steps (node, windows-dev-tools, npm i, ...) and I'm currently stuck on this error.

I've paved clean the repo, reinstalled node / windows-dev-tools, ... but it still occurs.

I'm a noob in node.js / rollup, so how can I debug this further?

d:\gdev\maplibre-gl-js>npm run build-dev

> maplibre-gl@2.1.7 build-dev
> rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --verbose

[!] TypeError: defaultLoader is not a function
TypeError: defaultLoader is not a function
    at Object.require.extensions.<computed> [as .ts] (d:\gdev\maplibre-gl-js\node_modules\rollup\dist\shared\loadConfigFile.js:617:13)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at loadConfigFromBundledFile (d:\gdev\maplibre-gl-js\node_modules\rollup\dist\shared\loadConfigFile.js:622:42)
    at loadConfigFile (d:\gdev\maplibre-gl-js\node_modules\rollup\dist\shared\loadConfigFile.js:565:11)
    at Object.loadAndParseConfigFile (d:\gdev\maplibre-gl-js\node_modules\rollup\dist\shared\loadConfigFile.js:545:21)
    at getConfigs (d:\gdev\maplibre-gl-js\node_modules\rollup\dist\bin\rollup:1691:39)
    at runRollup (d:\gdev\maplibre-gl-js\node_modules\rollup\dist\bin\rollup:1665:43)
Vasco
  • 1
  • 1
  • Welcome to SO! Could you please add the related file details as well ? Seems like the default func is not exported from the file you are trying to import. – Prabhat Mishra Mar 12 '22 at 07:37
  • Which file do you want? This is for [maplibre-gl-js](https://github.com/maplibre/maplibre-gl-js), after following [`CONTRIBUTING.md`](https://github.com/maplibre/maplibre-gl-js/blob/main/CONTRIBUTING.md#windows) steps. I should note I did the same steps on another machine and it worked. But I need to use this on my main dev machine and I have no idea how to start debugging it. – Vasco Mar 12 '22 at 23:33
  • I added some tracing to `rollup.js` to identify the config file, why it was undefined, but after a while it was not paying off. I ended up using WSL (Windows Subsystem for Linux)/Ubuntu and followed the Linux setup instructions. Works like a charm. Note: enlist again inside the VM. Accessing NTFS from Linux is ~50x slower than I/O on the VM's VHD. – Vasco Mar 17 '22 at 17:42

0 Answers0