Microbundle: [TS] Build completes but outputs `node-resolve` related error and exits with error code.

Created on 3 Jul 2019  路  5Comments  路  Source: developit/microbundle

Context

I'm trying to build a new typescript project with microbundle and, although the build completes (there are files in dist/), I get the error indicated below.

Running on:

System Version: macOS 10.14.5 (18F132)
Kernel Version: Darwin 18.6.0
NodeJS: v8.9.4

You can find the sample code for reproduction here:
https://gist.github.com/joaolucasl/3598ba6eb6f3d6f443c87916bc8c24bb

Evidences

When I try to build it as a Typescript project

LukeMacbookPro:mongoose-notekeeper-plugin luke$ npx microbundle
node-resolve: setting options.module is deprecated, please override options.mainFields instead
node-resolve: setting options.jsnext is deprecated, please override options.mainFields instead
node-resolve: setting options.module is deprecated, please override options.mainFields instead
node-resolve: setting options.jsnext is deprecated, please override options.mainFields instead
node-resolve: setting options.module is deprecated, please override options.mainFields instead
node-resolve: setting options.jsnext is deprecated, please override options.mainFields instead
dyld: lazy symbol binding failed: Symbol not found: __ZN4node19GetCurrentEventLoopEPN2v87IsolateE
  Referenced from: /Users/luke/Code/mongoose-notekeeper-plugin/node_modules/iltorb/build/bindings/iltorb.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN4node19GetCurrentEventLoopEPN2v87IsolateE
  Referenced from: /Users/luke/Code/mongoose-notekeeper-plugin/node_modules/iltorb/build/bindings/iltorb.node
  Expected in: flat namespace

Abort trap: 6
LukeMacbookPro:mongoose-notekeeper-plugin luke$ 

If I remove convert the file to plain JS:

LukeMacbookPro:mongoose-notekeeper-plugin luke$ npx microbundle
Build "mongooseNotekeeperPlugin" to dist:
question

Most helpful comment

@ForsakenHarmony it's fixed on microbundle@next

All 5 comments

iltorb is a dependency that's for brotli compression. According to the error it seems like something went wrong during npm install or maybe node 8 is not supported anymore by that library. If deleting node_modules and reinstalling them via npm install doesn't do the job I'd try running it with the latest node LTS version

I'm getting the same node-resolve error, on LTS node

Can you try if using microbundle@next makes any difference?

@ForsakenHarmony it's fixed on microbundle@next

Also make sure to compile via microbundle --target node. It looks like the error above is caused in part by Rollup bundling iltorb, which is not desirable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pascalduez picture pascalduez  路  12Comments

FezVrasta picture FezVrasta  路  11Comments

skipjack picture skipjack  路  11Comments

Andarist picture Andarist  路  17Comments

zzswang picture zzswang  路  14Comments