ray-input icon indicating copy to clipboard operation
ray-input copied to clipboard

Parse Error with ES6 importing?

Open rezaali opened this issue 8 years ago • 4 comments
trafficstars

ParseError: 'import' and 'export' may appear only with 'sourceType: module' line 16 ***/node_modules/ray-input/src/ray-input.js import OrientationArmModel from './orientation-arm-model' ^

rezaali avatar Mar 27 '17 14:03 rezaali

any ideas on why ray-input isn't importing ?

rezaali avatar Mar 27 '17 14:03 rezaali

I'm seeing this as well, while other similar libraries (like webvr-ui) are importing fine. It's not obvious to me what the difference is. :(

toji avatar Apr 24 '17 18:04 toji

I believe this is because we specify our browserify transforms in the package.json like so in replacement of our npm script calling browserify including any transforms. Otherwise my understanding is your parent project's transforms won't apply to node_modules/

hapticdata avatar Apr 24 '17 20:04 hapticdata

For what it's worth I have that in my own code, and I've tried pasting that into this repo's package.json as well but it didn't help. Renaming the main file to src/index.js instead of src/ray-input.js, though, DID fix it, because Javascript toolchains are magical in the worst way. 😡

toji avatar Apr 24 '17 20:04 toji