atom/electron-link

Electron-link cannot bundle @babel/core

aminya opened this issue · 0 comments

Bug Report

I am trying to update the babel plugin that is used in Atom internally, but Electron-link bundler gives me this error during bundling:

Details
2020-06-29T02:36:43.2059234Z Generating snapshot script at "/__w/1/s/out/startup.js" (3770)Unable to transform source code for module /__w/1/s/out/app/node_modules/@babel/core/lib/config/files/import.js.
2020-06-29T02:36:43.2059872Z SyntaxError: Unexpected token (9:9)
2020-06-29T02:36:43.2060285Z   at Parser.pp$4.raise (/__w/1/s/script/node_modules/acorn/dist/acorn.js:2825:15)
2020-06-29T02:36:43.2060817Z   at Parser.pp.unexpected (/__w/1/s/script/node_modules/acorn/dist/acorn.js:689:10)
2020-06-29T02:36:43.2061403Z   at Parser.pp$3.parseExprAtom (/__w/1/s/script/node_modules/acorn/dist/acorn.js:2266:21)
2020-06-29T02:36:43.2061975Z   at Parser.pp$3.parseExprSubscripts (/__w/1/s/script/node_modules/acorn/dist/acorn.js:2089:21)
2020-06-29T02:36:43.2062562Z   at Parser.pp$3.parseMaybeUnary (/__w/1/s/script/node_modules/acorn/dist/acorn.js:2066:19)
2020-06-29T02:36:43.2063135Z   at Parser.pp$3.parseExprOps (/__w/1/s/script/node_modules/acorn/dist/acorn.js:2010:21)
2020-06-29T02:36:43.2063813Z   at Parser.pp$3.parseMaybeConditional (/__w/1/s/script/node_modules/acorn/dist/acorn.js:1993:21)
2020-06-29T02:36:43.2070126Z   at Parser.pp$3.parseMaybeAssign (/__w/1/s/script/node_modules/acorn/dist/acorn.js:1968:21)
2020-06-29T02:36:43.2071153Z   at Parser.pp$3.parseExpression (/__w/1/s/script/node_modules/acorn/dist/acorn.js:1933:21)
2020-06-29T02:36:43.2073238Z   at Parser.pp$1.parseReturnStatement (/__w/1/s/script/node_modules/acorn/dist/acorn.js:1005:33)
2020-06-29T02:36:43.2074002Z   at Parser.pp$1.parseStatement (/__w/1/s/script/node_modules/acorn/dist/acorn.js:835:37)
2020-06-29T02:36:43.2075304Z   at Parser.pp$1.parseBlock (/__w/1/s/script/node_modules/acorn/dist/acorn.js:1161:23)
2020-06-29T02:36:43.2076941Z   at Parser.pp$3.parseFunctionBody (/__w/1/s/script/node_modules/acorn/dist/acorn.js:2671:24)
2020-06-29T02:36:43.2078497Z   at Parser.pp$1.parseFunction (/__w/1/s/script/node_modules/acorn/dist/acorn.js:1283:10)
2020-06-29T02:36:43.2080618Z   at Parser.pp$1.parseFunctionStatement (/__w/1/s/script/node_modules/acorn/dist/acorn.js:983:17)
2020-06-29T02:36:43.2081360Z   at Parser.pp$1.parseStatement (/__w/1/s/script/node_modules/acorn/dist/acorn.js:830:19)
2020-06-29T02:36:43.2090492Z   at Parser.pp$1.parseTopLevel (/__w/1/s/script/node_modules/acorn/dist/acorn.js:746:23)
2020-06-29T02:36:43.2091224Z   at Parser.parse (/__w/1/s/script/node_modules/acorn/dist/acorn.js:553:17)
2020-06-29T02:36:43.2093874Z   at Function.parse (/__w/1/s/script/node_modules/acorn/dist/acorn.js:576:37)
2020-06-29T02:36:43.2094399Z   at Object.parse (/__w/1/s/script/node_modules/acorn/dist/acorn.js:4949:19)
2020-06-29T02:36:43.2095688Z   at Object.parse (/__w/1/s/script/node_modules/electron-link/node_modules/recast/parsers/acorn.js:14:32)
2020-06-29T02:36:43.2096565Z   at Object.parse (/__w/1/s/script/node_modules/electron-link/lib/file-require-transform.js:26:50)
2020-06-29T02:36:43.2097408Z   at Object.parse (/__w/1/s/script/node_modules/electron-link/node_modules/recast/lib/parser.js:31:30)
2020-06-29T02:36:43.2098265Z   at FileRequireTransform.apply (/__w/1/s/script/node_modules/electron-link/lib/file-require-transform.js:23:23)
2020-06-29T02:36:43.2099091Z   at /__w/1/s/script/node_modules/electron-link/lib/generate-snapshot-script.js:55:56
2020-06-29T02:36:43.2099563Z   at Generator.next (<anonymous>:null:null)
2020-06-29T02:36:43.2100279Z   at step (/__w/1/s/script/node_modules/electron-link/lib/generate-snapshot-script.js:3:191)
2020-06-29T02:36:43.2101049Z   at /__w/1/s/script/node_modules/electron-link/lib/generate-snapshot-script.js:3:361

https://github.visualstudio.com/Atom/_build/results?buildId=74019&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=b525c197-f769-5e52-d38a-e6301f5260f2&l=3829

Environment

  System:
    OS: Windows 10 10.0.19041
  Binaries:
	apm  2.5.0
	npm  6.14.5
	node 10.20.1 x64
	atom unknown
	python 2.7.6
	git 1.9.1
  npmPackages:
    @babel/cli: 7.10.3 => 7.10.3
    @babel/core: 7.10.3 => 7.10.3
    @babel/plugin-proposal-class-properties: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-decorators: ^7.10.3 => 7.10.3
    @babel/plugin-proposal-do-expressions: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-export-default-from: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-export-namespace-from: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-function-bind: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-function-sent: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-json-strings: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-logical-assignment-operators: ^7.10.3 => 7.10.3
    @babel/plugin-proposal-nullish-coalescing-operator: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-numeric-separator: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-optional-chaining: ^7.10.3 => 7.10.3
    @babel/plugin-proposal-pipeline-operator: ^7.10.1 => 7.10.1
    @babel/plugin-proposal-throw-expressions: ^7.10.1 => 7.10.1
    @babel/plugin-syntax-dynamic-import: ^7.8.3 => 7.8.3
    @babel/plugin-syntax-import-meta: ^7.10.1 => 7.10.1
    @babel/plugin-transform-async-to-generator: 7.10.1 => 7.10.1
    @babel/preset-env: 7.10.3 => 7.10.3
    @babel/preset-flow: ^7.10.1 => 7.10.1
    @babel/preset-react: ^7.10.1 => 7.10.1

Possible Solution
Is there a version that babel recommends using here instead of 7.10.3? Can I transform babel itself to make it compatible with Electron 5?

Additional context