Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron 5 cannot bundle @babel/core #11757

Closed
aminya opened this issue Jun 29, 2020 · 2 comments
Closed

Electron 5 cannot bundle @babel/core #11757

aminya opened this issue Jun 29, 2020 · 2 comments
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@aminya
Copy link

aminya commented Jun 29, 2020

Bug Report

I am trying to update the babel plugin that is used in Atom internally, but Electron 5 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
Can I transform babel itself to make it compatible with Electron 5?

Additional context

@babel-bot
Copy link
Collaborator

Hey @aminya! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@aminya
Copy link
Author

aminya commented Jun 29, 2020

Seems to be unrelated to babel directly.

@aminya aminya closed this as completed Jun 29, 2020
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 28, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: needs triage outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

2 participants