Meteor 18.0.2 crashes randomly because of static-html unhandled promise

On my Linux (elementary os with ubuntu 18.04) laptop I got random crashes in development environment with Meteor 1.8.0.2. Any ideas? It looks like something not dependent on my web application.

/home/max/.meteor/packages/static-html/.1.2.2.13sf7qr.xzopi++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^
undefined
 => awaited here:
    at Promise.await (/home/max/.meteor/packages/static-html/.1.2.2.13sf7qr.xzopi++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:39:12)
    at JsOutputResource.finalize (/tools/isobuild/compiler-plugin.js:897:7)
    at JsOutputResource.hasPendingErrors (/tools/isobuild/compiler-plugin.js:924:10)
    at JsOutputResource.reportPendingErrors (/tools/isobuild/compiler-plugin.js:929:14)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:849:14)
    at each (/tools/isobuild/import-scanner.js:907:14)
    at _.each._.forEach (/home/max/.meteor/packages/meteor-tool/.1.8.0_2.1om3lwx.sy8++os.linux.x86_64+web.browser+web.browser.legacy+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:871:5)
    at each (/tools/isobuild/import-scanner.js:907:14)
    at _.each._.forEach (/home/max/.meteor/packages/meteor-tool/.1.8.0_2.1om3lwx.sy8++os.linux.x86_64+web.browser+web.browser.legacy+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:871:5)
    at each (/tools/isobuild/import-scanner.js:907:14)
    at _.each._.forEach (/home/max/.meteor/packages/meteor-tool/.1.8.0_2.1om3lwx.sy8++os.linux.x86_64+web.browser+web.browser.legacy+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:871:5)
    at each (/tools/isobuild/import-scanner.js:907:14)
    at _.each._.forEach (/home/max/.meteor/packages/meteor-tool/.1.8.0_2.1om3lwx.sy8++os.linux.x86_64+web.browser+web.browser.legacy+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:871:5)
    at each (/tools/isobuild/import-scanner.js:907:14)
    at _.each._.forEach (/home/max/.meteor/packages/meteor-tool/.1.8.0_2.1om3lwx.sy8++os.linux.x86_64+web.browser+web.browser.legacy+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:871:5)
    at outputFiles.forEach.file (/tools/isobuild/import-scanner.js:529:14)
    at Array.forEach (<anonymous>)
    at ImportScanner.scanImports (/tools/isobuild/import-scanner.js:527:22)
    at sourceBatches.forEach.batch (/tools/isobuild/compiler-plugin.js:1301:17)
    at Array.forEach (<anonymous>)
    at Function.computeJsOutputFilesMap (/tools/isobuild/compiler-plugin.js:1269:19)
    at ClientTarget._emitResources (/tools/isobuild/bundler.js:1121:8)
    at buildmessage.enterJob (/tools/isobuild/bundler.js:847:12)
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at ClientTarget.make (/tools/isobuild/bundler.js:835:18)
    at /tools/isobuild/bundler.js:3143:14
    at webArchs.forEach.arch (/tools/isobuild/bundler.js:3294:25)
    at Array.forEach (<anonymous>)
    at /tools/isobuild/bundler.js:3248:14
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at bundle (/tools/isobuild/bundler.js:3124:31)
    at files.withCache (/tools/isobuild/bundler.js:3069:32)
    at Object.withCache (/tools/fs/files.js:1712:12)
    at Object.bundle (/tools/isobuild/bundler.js:3069:16)
    at Profile.run (/tools/runners/run-app.js:569:24)
    at Function.run (/tools/tool-env/profile.js:490:12)
    at bundleApp (/tools/runners/run-app.js:568:34)
    at AppRunner._runOnce (/tools/runners/run-app.js:853:35)
    at AppRunner._fiber (/tools/runners/run-app.js:908:28)
    at /tools/runners/run-app.js:398:12

you maybe can try this :
in ~/your_project/.meteor/packages replace the line
static-html
by
blaze-html-templates

Thanks, I’ll try but I’m using static-html because Meteor Guide at https://guide.meteor.com/react.html states:

Every new Meteor app includes Blaze, Meteor’s default templating system, by default. If you are not planning on using React and Blaze together, you can remove Blaze from your project by running:

meteor remove blaze-html-templates
meteor add static-html

Did it start after you changed something specific?

We were having some weird errors with Meteor, and just cloned our repo again, ran npm install and everything started working again as it should.

It could be. Not sure tough. I’ll try what you suggest. Thanks.

The only time I’ve seen unhelpful errors like this I reported here: https://github.com/meteor/meteor/issues/10366

It might be a different issue, but it might help with debugging.
In my case it was because of an error in a compiled file (eg, stylus, sass etc), which when imported from a js file ends up being turned into a JsOutputResource. In your stack trace you can see the calls to JsOutputResource.hasPendingErrors etc.

Are you importing styles or other compiled files into js somewhere, possibly with a layer of dynamic imports and/or lazy loaded packages?

No, I don’t think so. I’m creating a React web app and I import .less files using a standard import './filename.less'

BTW I tried what you suggest and I still have the same the problem

Is that from a JS file or are all stylesheets loaded from the one entrypoint that isn’t referenced in JS?