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

Built in support for including common Webpack plugins into the build fails silently, excluding the plugin from the build #2471

Open
deneboulton opened this issue Jun 12, 2024 · 0 comments

Comments

@deneboulton
Copy link

Description

Modular Scripts includes built in support for checking if Webpack plugins for two popular dependencies used in JP - @finos/perspective and react-monaco-editor - are also available in the build.

If a dependency is found, but a plugin is not the build warns about this. If both dependency and plugin are found then the build script wants to instantiate the plugin and add it to the Webpack Config.

Observed in a cjs build execution.

Expected

Associated plugins when found are included in the Webpack Config.

If at the stage of including the plugin there is a failure then the greater build fails and the issue is messaged to the user.

Actual

When a plugin is available we incorrectly identity the entity that is the constructor from the plugin package.
An error is thrown.
No log message is output.
The build continues, silently swallowing the issue. The build, if it continues to be successful, will output artifacts that have not been influenced by the plugin.

Issue resides here, where we inadvertently use the outcome of this as a constructor.

Issue is not present in some older versions of modular-scripts, e.g., 3.6.0, it looks like it was introduced when the build script was transitioned to .ts from .js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant