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

Hush webpack warnings when blueprint is not installed #109

Closed
nomcopter opened this issue Mar 26, 2019 · 7 comments
Closed

Hush webpack warnings when blueprint is not installed #109

nomcopter opened this issue Mar 26, 2019 · 7 comments

Comments

@nomcopter
Copy link
Owner

nomcopter commented Mar 26, 2019

Perhaps switching to require.resolve is quieter https://stackoverflow.com/a/15303236

@iAL-Ahmed
Copy link

@nomcopter Thanks for making this issue. I was just about to make an issue asking if we could either get rid of the webpack warnings or find some way to make blueprint more shakable.

@nomcopter
Copy link
Owner Author

Hmm.. Nope. That didn't work. Although based on some quick Googling it looks like a pretty common and hard-to-avoid error obnoxiously: webpack/webpack#7713 (comment)

@filipkaniatest
Copy link

Should we have this reopened? The issue persists

@nomcopter
Copy link
Owner Author

@filipkaniatest I don't think there is anything that can be done in react-mosaic. All I could find seemed to suggest that the only way around it seems to be using warningsFilter in one's webpack config.

@mejackreed
Copy link
Contributor

We do it using the webpack ignore plugin: ProjectMirador/mirador#1871

@gunn4r
Copy link

gunn4r commented Jul 23, 2019

We tried the webpack ignore plugin but it adds significant overhead to the build time. Using the warningsFilter seemed to work a much better with little impact on the build time.

Though it does result in webpack showing Compiled with warnings but then not showing the warnings (obviously since we filtered them).

Would be great to eliminate this issue entirely.

@stevemk14ebr
Copy link

stevemk14ebr commented Feb 2, 2021

This fails the build on parcel2, removing the require.resolve's fixes the build. This issue should be re-opened as it introduces a bug when using parcel:

🚨 Build failed.
@parcel/packager-js: `require.resolve` calls for excluded assets are only supported with outputFormat: 'commonjs'
/home/steve/repos/Aster/src/client/node_modules/react-mosaic-component/lib/util/OptionalBlueprint.js:32:9
  31 |         // https://github.com/nomcopter/react-mosaic/issues/109
> 32 |         require.resolve('@blueprintjs/core');
>    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  33 |         require.resolve('@blueprintjs/icons');
  34 |         (_a = require('@blueprintjs/core'), Classes = _a.Classes, OptionalBlueprint.Icon = _a.Icon);
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! flareup@2.0.0 build: `parcel build pages/*.js pages/*.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flareup@2.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/steve/.npm/_logs/2021-02-02T16_26_04_786Z-debug.log

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

6 participants