Unexpected token export

I got the following error when the package ipfs-http-client@v36.0.0 was installed. The error was:

Uncaught SyntaxError: Unexpected token export
babel-runtime.js?hash=9a06c8d9744a0bbc079475d7a4faff8d74bba04d:17 Uncaught TypeError: Cannot read property 'meteorInstall' of undefined
    at babel-runtime.js?hash=9a06c8d9744a0bbc079475d7a4faff8d74bba04d:17
    at babel-runtime.js?hash=9a06c8d9744a0bbc079475d7a4faff8d74bba04d:155
(anonymous) @ babel-runtime.js?hash=9a06c8d9744a0bbc079475d7a4faff8d74bba04d:17
(anonymous) @ babel-runtime.js?hash=9a06c8d9744a0bbc079475d7a4faff8d74bba04d:155
...

The error located at export {default} from 'ky'. The error context is:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}},"ky-universal":{"package.json":function(require,exports,module){

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                     //
// node_modules/ky-universal/package.json                                                                              //
//                                                                                                                     //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                                                       //
module.exports = {
  "name": "ky-universal",
  "version": "0.3.0",
  "browser": "browser.js"
};

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

},"browser.js":function(){

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                     //
// node_modules/ky-universal/browser.js                                                                                //
//                                                                                                                     //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                                                       //
export {default} from 'ky';
export * from 'ky';

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}},"ky":{"package.json":function(require,exports,module){

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                     //
// node_modules/ky/package.json                                                                                        //
//                                                                                                                     //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                                                                                       //
module.exports = {
  "name": "ky",
  "version": "0.13.0"
};

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

},"index.js":function(){

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                     //
// node_modules/ky/index.js                                                                                            //
//                                                                                                                     //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Environment:
Meteor: 1.8.1
Node: 8.15.1

How to fix it?

I’d do the following

meteor update --release 1.8.2-beta.18

…but you can also try to symlink the package to make sure that nasty export gets transpiled away:

cd myapp
mkdir imports
cd imports
ln -s ../node_modules/ipfs-http-client .
1 Like

The error was fixed when Meteor is updated to 1.8.2-rc.3. But now it is too slow (over 1 minute) to load the homepage even running on a local server. Any suggestion?