Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

JS compilation error causes silent failure to compile unrelated components #117

@agarzola

Description

@agarzola

We’ve run into an issue where use of Math.abs is causing the build task to fail silently, generating only a subset of our components. The issue is similar to what is described in #114, but it not only stops JS compilation: a handful of components (their templates, stylesheets, even their directories) are entirely omitted from compilation and the build task completes “successfully”. Removing the offending line consistently causes the previously missing components to be compiled correctly.

Possible root cause

I believe the issue is that gulp-babel (or, more precisely, @babel/minify) is emitting an error, but because there is no handling in emulsify-gulp, we never hear of it. Since this project uses Gulp pre-v4 (which does not fail on thrown errors), the task fails silently. I suspect a failure of the scripts task is causing the pl:full task to stop rendering components because tasks are run in parallel the way they are declared here, but I could be wrong about that. What I can say for sure is that removing Math.abs from the offending JS file results in correctly-compiled components, and re-introducing Math.abs consistently causes the problem to arise.

Proposed solution

Logging the error to the console would, at the very least, make the problem more visible. Ideally, however, we would find a way to surface the error by exiting with a non-zero code, at least in the case of the build task (I realize this would be annoying in the theme task, though we should at least be logging bright red errors to the console in that case).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions