Get rid of continue statement that was throwing error by Babel on Angular #1

Closed
NagRock wants to merge 1 commit from main into main
NagRock commented 2021-01-12 11:16:49 +01:00 (Migrated from github.com)

Hi, after migration from @codemirror/next to @codemirror/lint I'm getting error during angular compilation:

ERROR in C:/my-app/node_modules/@codemirror/lint/dist/index.js
Module build failed (from C:/my-app/node_modules/@angular-devkit/build-angular/node_modules/babel-loader/lib/index.js):
TypeError: C:\my-app\node_modules\@codemirror\lint\dist\index.js: Property body expected type of array but got null
    at validate (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\definitions\utils.js:160:13)
    at Object.validate (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\definitions\utils.js:229:7)
    at validateField (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\validators\validate.js:24:9)
    at Object.validate (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\validators\validate.js:17:3)
    at NodePath._replaceWith (C:\my-app\node_modules\@babel\core\node_modules\@babel\traverse\lib\path\replacement.js:179:7)

After some changes I've started getting error: SyntaxError: C:\workspaces\cluster\ui\angular\angular.server\node_modules\@codemirror\lint\dist\index.js: Unsyntactic continue (209:21)

When I get rid of this continue and changed implementation to proposed in the PR the Angular app is compiling.
I did some unit tests for this change but the function is not exported so I didn't commit them.

Hi, after migration from `@codemirror/next` to `@codemirror/lint` I'm getting error during angular compilation: ``` ERROR in C:/my-app/node_modules/@codemirror/lint/dist/index.js Module build failed (from C:/my-app/node_modules/@angular-devkit/build-angular/node_modules/babel-loader/lib/index.js): TypeError: C:\my-app\node_modules\@codemirror\lint\dist\index.js: Property body expected type of array but got null at validate (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\definitions\utils.js:160:13) at Object.validate (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\definitions\utils.js:229:7) at validateField (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\validators\validate.js:24:9) at Object.validate (C:\my-app\node_modules\@babel\core\node_modules\@babel\types\lib\validators\validate.js:17:3) at NodePath._replaceWith (C:\my-app\node_modules\@babel\core\node_modules\@babel\traverse\lib\path\replacement.js:179:7) ``` After some changes I've started getting error: `SyntaxError: C:\workspaces\cluster\ui\angular\angular.server\node_modules\@codemirror\lint\dist\index.js: Unsyntactic continue (209:21)` When I get rid of this continue and changed implementation to proposed in the PR the Angular app is compiling. I did some unit tests for this change but the function is not `exported` so I didn't commit them.
marijnh commented 2021-01-12 11:43:22 +01:00 (Migrated from github.com)

I think that's a bug in the Angular Babel-loader, because there really isn't anything wrong with those loops, and plain Babel seems to handle them fine. I recommend reporting the bug in the Angular project—I'm not really prepared to randomly adjust code in order to work around problems in other software.

I think that's a bug in the Angular Babel-loader, because there really isn't anything wrong with those loops, and plain Babel seems to handle them [fine](https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&spec=false&loose=false&code_lz=GYVwdgxgLglg9mABAQwM6pgczAaQKYCeqAFMtPGKgFyIBOeyAJggDYGICC5CA2gLqIAPonCM8wGGDyMAlIgDeAKESIWeKCnRYpjGqii1JmfogC8ifssQxgiUt0pyysBNUTA4tO2o3ywyAFs8AF9EOFtnClQ5JRUVDy9iH2szRAAGAG4UgB5EfyCAOjUwTCgACyyYAGoqmKs41XVECDLU_LweGD56uJs7AHoeZABaAC8OYYAtPn6CqDx9Yha5ADIVxABCNAxsaQLUOCClswA-Zrm4ABk4AHc8WgBhNDxiOVNzFovru8fn15k6g0GtttHsAA4gVBlJZlGQ9BoQBCwMAgPAoByoeGIYI9HHArS7RgFCFQ4gAIjJcJUeLo6hAtCQIMJihxQA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.12.12&externalPlugins=). I recommend reporting the bug in the Angular project—I'm not really prepared to randomly adjust code in order to work around problems in other software.
marijnh commented 2021-01-12 11:44:25 +01:00 (Migrated from github.com)

Oh, hold on, if I check es2015 babel itself crashes, so that points to a Babel bug.

Oh, hold on, if I check `es2015` babel itself crashes, so that points to a Babel bug.
marijnh commented 2021-01-12 11:52:37 +01:00 (Migrated from github.com)

I've filed Babel bug #12610.

I've filed Babel bug [#12610](https://github.com/babel/babel/issues/12610).
NagRock commented 2021-01-18 09:50:43 +01:00 (Migrated from github.com)

@marijnh maybe this can be merged and reverted when new version of babel will be released? We cannot use codemirror right now because of this bug. It fails during app compilation.

@marijnh maybe this can be merged and reverted when new version of babel will be released? We cannot use codemirror right now because of this bug. It fails during app compilation.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/lint!1
No description provided.