Skip to content

[7.0.0-beta.41] Cannot read property 'slice' of undefined #7572

@sanex3339

Description

@sanex3339

This is a bug report

After updating from beta.40 on beta.41 i got an error
Module build failed: TypeError: [BABEL] /foobar/javascript-obfuscator/index.ts: Cannot read property 'slice' of undefined (While processing: "/foobar/node_modules/@babel/plugin-transform-runtime/lib/index.js")

With beta.40 everything is ok.

Full error log:

TypeError: [BABEL] test-tmp/index.js: Cannot read property 'slice' of undefined (While processing: "/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/@babel/plugin-transform-runtime/lib/index.js")
    at throwVersionError (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/@babel/helper-plugin-utils/lib/index.js:41:15)
    at Object.assertVersion (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/@babel/helper-plugin-utils/lib/index.js:11:11)
    at /Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/@babel/plugin-transform-runtime/lib/index.js:19:7
    at /Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/@babel/helper-plugin-utils/lib/index.js:16:12
    at /Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/option-manager.js:238:14
    at cachedFunction (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/caching.js:48:17)
    at loadPluginDescriptor (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/option-manager.js:272:28)
    at /Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/option-manager.js:56:14
    at Array.map (<anonymous>)
    at OptionManager.mergeOptions (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/option-manager.js:55:34)
    at OptionManager.init (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/option-manager.js:114:14)
    at manageOptions (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/option-manager.js:40:30)
    at loadConfig (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/config/index.js:17:37)
    at Object.transformFileSync (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-core/lib/transform-file-sync.js:20:36)
    at Object.compile (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/util.js:71:18)
    at write (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/dir.js:30:21)
    at handleFile (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/dir.js:54:20)
    at /Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/dir.js:78:9
    at Array.forEach (<anonymous>)
    at handle (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/dir.js:75:56)
    at Array.forEach (<anonymous>)
    at _default (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/dir.js:86:15)
    at Object.<anonymous> (/Users/sanex/PhpstormProjects/javascript-obfuscator/node_modules/babel-cli/lib/babel/index.js:185:1)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)

Input Code

Huge project, can't extract place that triggering this error

Babel/Babylon Configuration (.babelrc, package.json, cli command)

{
  "generatorOpts": {
    "retainFunctionParens": true
  },
  "presets": [
    ["@babel/preset-env", {
      "targets": {
        "node": "4.8"
      },
      "forceAllTransforms": true
    }]
  ],
  "plugins": [
    "@babel/transform-runtime"
  ]
}

Expected Behavior

No error

Current Behavior

Error described above

Your Environment

software version(s)
Babel 7.0.0-beta.41
node 9.1.0
Operating System MacOs

Metadata

Metadata

Assignees

No one assigned

    Labels

    7.x: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions