Pkg: strong-error-handler results in AssertionError [ERR_ASSERTION]: *** setRootDir: Intl dir not found under:

Created on 26 Apr 2018  路  3Comments  路  Source: vercel/pkg

Hi, I just tried pkg with an app that is using expressjs with the strong-error-handler lib and got the following issue.

Example x1.js:

const express = require('express')
const errorHandler = require('strong-error-handler')

const app = express()

app.get('/', (req, res) => { res.send('hello') })
app.use(
  errorHandler({
    debug: false,
    log: true
  })
)
app.listen(3001)

package.json:

{
  "dependencies": {
    "express": "^4.16.3",
    "strong-error-handler": "^2.3.2"
  }
}
pkg x1.js
$ ./x1-macos 
pkg/prelude/bootstrap.js:1172
      throw error;
      ^

AssertionError [ERR_ASSERTION]: *** setRootDir: Intl dir not found under: /snapshot/a/node_modules/strong-error-handler
    at Object.setRootDir (/snapshot/a/node_modules/strong-globalize/lib/helper.js:155:3)
    at Function.SetRootDir (/snapshot/a/node_modules/strong-globalize/index.js:79:13)
    at Object.<anonymous> (/snapshot/a/node_modules/strong-error-handler/lib/handler.js:10:4)
    at Module._compile (pkg/prelude/bootstrap.js:1243:22)
    at Object.Module._extensions..js (module.js:644:10)
    at Module.load (module.js:552:32)
    at tryModuleLoad (module.js:495:12)
    at Function.Module._load (module.js:487:3)
    at Module.require (module.js:577:17)
    at Module.require (pkg/prelude/bootstrap.js:1153:31)

Most helpful comment

This error is because, pkg is not packaging intl dir by default. I tried to include the same. But, i got some other not found error.

So, finally i did the below to include everything and it worked perfectly.

"pkg": {
    "assets": "**"
  }

All 3 comments

I am trying to pkg a Loopback application it is the same error, looking and the pkg don't package the intl folder, how can I package this folders? tried to put in "assets" in package.json, didn't work.

Same error here while trying to package a Loopback 3 application. Any hints?

This error is because, pkg is not packaging intl dir by default. I tried to include the same. But, i got some other not found error.

So, finally i did the below to include everything and it worked perfectly.

"pkg": {
    "assets": "**"
  }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ydubois-fr picture ydubois-fr  路  4Comments

Araknos picture Araknos  路  4Comments

jflayhart picture jflayhart  路  4Comments

serzhiio picture serzhiio  路  3Comments

peterjwest picture peterjwest  路  3Comments