Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of source-map-support TypeError: frame.getFileName is not a function in node 10

I just upgraded from node 8 to node 10 and all my protractor test cases failed.

When dig into it, I found that source map support is causing the issue. Anyone resolved it or have a workaround.

✗ encountered a declaration exception
  - TypeError: frame.getFileName is not a function
      at isInsideNodeModules (internal/util.js:360:28)
      at showFlaggedDeprecation (buffer.js:149:8)
      at new Buffer (buffer.js:174:3)
      at Array.<anonymous> (/Users/k26686/aniruddh/develop/after-india-trip/shepherd/node_modules/source-map-support/source-map-support.js:149:21)
      at /Users/k26686/aniruddh/develop/after-india-trip/shepherd/node_modules/source-map-support/source-map-support.js:53:24
      at mapSourcePosition (/Users/k26686/aniruddh/develop/after-india-trip/shepherd/node_modules/source-map-support/source-map-support.js:171:21)
      at wrapCallSite (/Users/k26686/aniruddh/develop/after-india-trip/shepherd/node_modules/source-map-support/source-map-support.js:343:20)
      at /Users/k26686/aniruddh/develop/after-india-trip/shepherd/node_modules/source-map-support/source-map-support.js:378:26
      at Array.map (<anonymous>)
      at Function.prepareStackTrace (/Users/k26686/aniruddh/develop/after-india-trip/shepherd/node_modules/source-map-support/source-map-support.js:377:24)

There is also a issue in github github isslue link going on but any one have a quick fix?

like image 775
Aniruddha Das Avatar asked Apr 26 '18 14:04

Aniruddha Das


2 Answers

You just have to upgrade to version 10.1.0 of NodeJS.

This is a bug in version 10.0.0.

like image 50
luislhl Avatar answered Sep 24 '22 03:09

luislhl


We found a workaround if using Babel to compile code. Switching your source maps from inline to file fixed this for us.

Change Babel compilation from:

babel --source-maps inline

to

babel --source-maps

like image 28
Druska Avatar answered Sep 23 '22 03:09

Druska