analytics: error importing in Meteor 1.5 - Path must be a string. Received undefined

Hi, importing of okgrow:analytics , @okgrow/auto-analytics is broken in Meteor 1.5.

After upgrading to Meteor 1.5 I get:

<...>/.meteor/packages/coffeescript/.1.12.3_1.yrisuj++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.relative (path.js:496:3)
    at <...>/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/static-assets/server/mini-files.js:114:14
    at ImportScanner._getRelativeImportId (/tools/isobuild/import-scanner.js:534:7)
    at /tools/isobuild/import-scanner.js:509:33
    at _.each._.forEach (/home/qba/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._resolve (/tools/isobuild/import-scanner.js:498:7)
    at /tools/isobuild/import-scanner.js:567:8
    at _.each._.forEach (/home/qba/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:561:7)
    at /tools/isobuild/import-scanner.js:675:5
    at _.each._.forEach (/home/qba/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:561:7)
    at /tools/isobuild/import-scanner.js:675:5
    at _.each._.forEach (<...>/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:561:7)
    at /tools/isobuild/import-scanner.js:675:5
    at _.each._.forEach (/home/qba/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:561:7)
    at /tools/isobuild/import-scanner.js:675:5
    at _.each._.forEach (/home/qba/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:561:7)
    at /tools/isobuild/import-scanner.js:357:14
    at Array.forEach (native)
    at ImportScanner.scanImports (/tools/isobuild/import-scanner.js:355:22)
    at /tools/isobuild/compiler-plugin.js:1040:17
    at Array.forEach (native)
    at Function.computeJsOutputFilesMap (/tools/isobuild/compiler-plugin.js:1008:19)
    at ClientTarget._emitResources (/tools/isobuild/bundler.js:1059:8)
    at /tools/isobuild/bundler.js:830:12
    at /tools/utils/buildmessage.js:359:18
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:352:34
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:350:23
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
    at ClientTarget.make (/tools/isobuild/bundler.js:821:18)
    at /tools/isobuild/bundler.js:2879:14
    at /tools/isobuild/bundler.js:2968:20
    at Array.forEach (native)
    at Function._.each._.forEach (/home/qba/.meteor/packages/meteor-tool/.1.5.0.utbu0o++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    at /tools/isobuild/bundler.js:2967:7
    at /tools/utils/buildmessage.js:271:13
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:264:29
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:262:18
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:253:23
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.capture (/tools/utils/buildmessage.js:252:19)
    at bundle (/tools/isobuild/bundler.js:2860:31)
    at /tools/isobuild/bundler.js:2807:32
    at Object.withCache (/tools/fs/files.js:1652:12)
    at Object.exports.bundle (/tools/isobuild/bundler.js:2807:16)
    at /tools/runners/run-app.js:588:36
    at Function.run (/tools/tool-env/profile.js:490:12)
    at bundleApp (/tools/runners/run-app.js:587:34)
    at [object Object]._.extend._runOnce (/tools/runners/run-app.js:631:35)
    at [object Object]._.extend._fiber (/tools/runners/run-app.js:890:28)
    at /tools/runners/run-app.js:417:12

Debugging the ImportScanner (/tools/isobuild/import-scanner.js:617), reveals that the two variables in the ImportScanner.prototype._getRelativeImportId have values as follows:

parentPath = node_modules/meteor/okgrow:analytics/node_modules/@okgrow/auto-analytics/vendor/analytics.min.js
childPath = undefined

removing okgrow:analytics from the project fixes the problem.

I don’t know enough about es6 imports and the recent changes to meteor/babel to know why this is happening…

But I think it’s a good start for investigation. Or maybe I am doing something horribly wrong? Possibly this is an issue for the meteor team…

For the sake of completeness.

> meteor npm --version
4.6.1
> meteor node --version
v4.8.3

.meteor/packages:

meteor-base@1.1.0
mobile-experience@1.0.4
mongo@1.1.18

reactive-var@1.0.11

session@1.1.7
tracker@1.1.3                 # Meteor's client-side reactive programming library

standard-minifier-css@1.3.4
standard-minifier-js@2.1.0
es5-shim@4.6.15
ecmascript@0.8.0

accounts-base@1.3.0
accounts-password@1.3.6
accounts-facebook@1.2.0
accounts-google@1.2.0

check@1.2.5
audit-argument-checks@1.0.7
browser-policy@1.1.0

fourseven:scss@4.5.0
alanning:roles
themeteorchef:bert
static-html@1.1.11
mdg:validated-method
dburles:factory@1.0.0
ddp-rate-limiter@1.0.7
shell-server@0.2.3
aldeed:collection2-core@2.0.0

deanius:promise
gadicohen:sitemaps
deepwell:raven
dburles:collection-helpers
std:accounts-ui
std:accounts-bootstrap
std:accounts-basic
accounts-oauth@1.1.15
accounts-twitter@1.3.0
kubs:accounts-passwordless
apollo
bozhao:link-accounts
zetoff:accounts-material-ui
dynamic-import
ostrio:files

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 21 (6 by maintainers)

Most upvoted comments

running into this issue with 3.0.2 😢

@416serg @Almaju @fadomire We have released v3.0.3 please update to the latest and everything should be working again! 🎉 😃

The update also includes two fixes to the data.title for usage with react-router + react-helmet and the referrer now behaves as aspected when using back/fwd buttons. 🔥

3.0.3 worked for me! thanks!

@416serg Thanks, we are looking into it now. Hopefully can resolve quickly. 👍

I have 3.0.1 working on multiple production applications hosted on Galaxy without errors.

Thank you for turning this around so quickly.

Fixed with version 3.0.1.

@kubami Thanks for reporting this, I believe you are on the right track and the importing of @okgrow/auto-analytics is causing issues.

Could you try using okgrow:analytics@2.1.3, e.g (meteor add okgrow:analytics@2.1.3) as a short term solution until the issue is resolved.