Upgrade to 1.5 bundle-visualizer error

Hi,
I upgraded my project to 1.5 and added bundle visualizer but when i start my app i get the below error. I am using Angular 4. This error goes away when i remove package. What am I missing?

Unhandled Promise rejection: Cannot find module 'assert' ; Zone: <root> ; Task: Promise.then ; Value: Error: Cannot find module 'assert'
    at c (d983cb8….js?meteor_js_resource=true:23)
    at e (d983cb8….js?meteor_js_resource=true:23)
    at eval (/node_modules/meteor/bundle-visualizer/sunburst.js:1)
    at d983cb8….js?meteor_js_resource=true:145
    at l (d983cb8….js?meteor_js_resource=true:23)
    at r.e [as require] (d983cb8….js?meteor_js_resource=true:23)
    at f (d983cb8….js?meteor_js_resource=true:145)
    at d983cb8….js?meteor_js_resource=true:145
    at t.invoke (d983cb8….js?meteor_js_resource=true:25)
    at n.run (d983cb8….js?meteor_js_resource=true:25) Error: Cannot find module 'assert'
    at c (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:23:431)
    at e (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:23:544)
    at eval (/node_modules/meteor/bundle-visualizer/sunburst.js:1:232)
    at http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:145:609
    at l (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:23:1087)
    at r.e [as require] (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:23:524)
    at f (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:145:968)
    at http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:145:1199
    at t.invoke (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:25:262662)
    at n.run (http://localhost:3000/d983cb84c2ae8e8b677ef81fa4088e0e24ae773e.js?meteor_js_resource=true:25:257860)
r.onUnhandledError @ d983cb8….js?meteor_js_resource=true:25
n @ d983cb8….js?meteor_js_resource=true:25
t @ d983cb8….js?meteor_js_resource=true:25
r.microtaskDrainDone @ d983cb8….js?meteor_js_resource=true:25
o @ d983cb8….js?meteor_js_resource=true:25
(anonymous) @ d983cb8….js?meteor_js_resource=true:3
d983cb8….js?meteor_js_resource=true:25 Error: Uncaught (in promise): Error: Cannot find module 'assert'
Error: Cannot find module 'assert'
    at c (d983cb8….js?meteor_js_resource=true:23)
    at e (d983cb8….js?meteor_js_resource=true:23)
    at eval (/node_modules/meteor/bundle-visualizer/sunburst.js:1)
    at d983cb8….js?meteor_js_resource=true:145
    at l (d983cb8….js?meteor_js_resource=true:23)
    at r.e [as require] (d983cb8….js?meteor_js_resource=true:23)
    at f (d983cb8….js?meteor_js_resource=true:145)
    at d983cb8….js?meteor_js_resource=true:145
    at t.invoke (d983cb8….js?meteor_js_resource=true:25)
    at n.run (d983cb8….js?meteor_js_resource=true:25)
    at c (d983cb8….js?meteor_js_resource=true:23)
    at e (d983cb8….js?meteor_js_resource=true:23)
    at eval (/node_modules/meteor/bundle-visualizer/sunburst.js:1)
    at d983cb8….js?meteor_js_resource=true:145
    at l (d983cb8….js?meteor_js_resource=true:23)
    at r.e [as require] (d983cb8….js?meteor_js_resource=true:23)
    at f (d983cb8….js?meteor_js_resource=true:145)
    at d983cb8….js?meteor_js_resource=true:145
    at t.invoke (d983cb8….js?meteor_js_resource=true:25)
    at n.run (d983cb8….js?meteor_js_resource=true:25)
    at u (d983cb8….js?meteor_js_resource=true:25)
    at u (d983cb8….js?meteor_js_resource=true:25)
    at d983cb8….js?meteor_js_resource=true:25
    at t.invokeTask (d983cb8….js?meteor_js_resource=true:25)
    at n.runTask (d983cb8….js?meteor_js_resource=true:25)
    at o (d983cb8….js?meteor_js_resource=true:25)
    at d983cb8….js?meteor_js_resource=true:3
    at <anonymous>
r.onUnhandledError @ d983cb8….js?meteor_js_resource=true:25
n @ d983cb8….js?meteor_js_resource=true:25
t @ d983cb8….js?meteor_js_resource=true:25
r.microtaskDrainDone @ d983cb8….js?meteor_js_resource=true:25
o @ d983cb8….js?meteor_js_resource=true:25
(anonymous) @ d983cb8….js?meteor_js_resource=true:3
1 Like

Had to do this to make it work…

meteor npm --save install assert

8 Likes

I added the dev option to avoid adding the assert package to the production bundle.

I’m using Meteor 1.6.1.
This should be fixed…

meteor npm --save-dev install assert
1 Like

Just ran into this in Meteor 2.7.1.

Using the below fixes the issue:

meteor npm --save-dev install assert

I don’t see it on a fresh project install of Meteor so I’m not sure what the underlying cause is. Reviving this thread in case someone else comes across the same issue and has ideas.