oscarfonts / mapbox-gl-cordova-offline

Offline vector maps in Cordova using Mapbox GL JS
Other
60 stars 36 forks source link

Build fails on node 10.5.0, windows #30

Closed adamhaile closed 5 years ago

adamhaile commented 5 years ago

A fresh pull followed by npm install and npm run build produces the following error:

PS C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline> node -v
v10.5.0

PS C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline> npm run build

> mapbox-gl-cordova-offline@0.2.0 build C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline
> rollup -c --environment BUILD:production

src/index.js, src/worker.js → rollup/build/mapboxgl...
[!] TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received '\u0000commonjs-proxy:C:\\Users\\Adam Haile\\Desktop\\Mi-Co\\Github\\mapbox-gl-cordova-offline\\node_modules\\ieee754\\package.j...
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received '\u0000commonjs-proxy:C:\\Users\\Adam Haile\\Desktop\\Mi-Co\\Github\\mapbox-gl-cordova-offline\\node_modules\\ieee754\\package.j...
    at Object.readFile (fs.js:301:3)
    at next (C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline\node_modules\browser-resolve\index.js:98:12)
    at load_shims (C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline\node_modules\browser-resolve\index.js:116:7)
    at resolve (C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline\node_modules\browser-resolve\index.js:236:5)
    at C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline\node_modules\rollup-plugin-node-resolve\dist\rollup-plugin-node-resolve.cjs.js:66:5
    at new Promise (<anonymous>)
    at resolveId$1 (C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline\node_modules\rollup-plugin-node-resolve\dist\rollup-plugin-node-resolve.cjs.js:63:11)
    at C:\Users\Adam Haile\Desktop\Mi-Co\Github\mapbox-gl-cordova-offline\node_modules\rollup\dist\rollup.js:5990:113

This is on Windows, if that matters.

From a google search, looks like this might be an incompatibility b/w rollup-plugin-commonjs and node 9+: https://github.com/rollup/rollup/issues/1782

michogar commented 5 years ago

Hi @adamhaile and thanks for reporting. We don't have any windows license to check and it looks like an external problem to the library code. Feel free to try deep into the issue and keep us informed if you get something. PRs are welcome.

BR.

hailengc commented 5 years ago

@adamhaile , me too encounter this problem when compile mapbox-gl-js on windows use node v10.15.0, how did you solve this issue?