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

Use non-minified packages in dev mode #104253

Closed
Tracked by #104519 ...
mshustov opened this issue Jul 2, 2021 · 6 comments · Fixed by #105971
Closed
Tracked by #104519 ...

Use non-minified packages in dev mode #104253

mshustov opened this issue Jul 2, 2021 · 6 comments · Fixed by #105971
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Operations Team label for Operations Team

Comments

@mshustov
Copy link
Contributor

mshustov commented Jul 2, 2021

Packages under https://github.com/elastic/kibana/tree/master/packages folder are built and minified during bootstrap step.
When a developer runs Kibana in dev mode, the minified version of such a package will be used. It worsens DX since code is barely readable:

Uncaught Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at Dl (kbn-ui-shared-deps.js:390)
    at kbn-ui-shared-deps.js:390
    at Us (kbn-ui-shared-deps.js:390)
    at wa (kbn-ui-shared-deps.js:390)
    at ml (kbn-ui-shared-deps.js:390)
    at fl (kbn-ui-shared-deps.js:390)
    at ol (kbn-ui-shared-deps.js:390)
    at kbn-ui-shared-deps.js:390
    at t.unstable_runWithPriority (kbn-ui-shared-deps.js:398)
    at $r (kbn-ui-shared-deps.js:390)

Also, some warnings for developers are trimmed and won't be emitted to the logs.

The developer should be able to run dev mode using the dev version of a package with un-minified code.

@mshustov mshustov added bug Fixes for quality problems that affect the customer experience Team:Operations Team label for Operations Team labels Jul 2, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@tonyaw
Copy link

tonyaw commented Nov 14, 2022

@mshustov and @mistic ,
I'm using Kibana v8.5.0 to develop a plugin, I can still see the Minified error with "yarn start".
Could you please help to explain why, and how to disable the Minified?

Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
React 11
unstable_runWithPriority scheduler.production.min.js:18
React 5
getSavedVisInstance use_saved_vis_instance.ts:117
useSavedVisInstance use_saved_vis_instance.ts:143

@spalger
Copy link
Contributor

spalger commented Nov 14, 2022

@tonyaw the error claims that this is caused by minification, but that's not actually the case. If you set the mode in the webpack config here to development then run yarn kbn bootstrap to rebuild the ui-shared-deps again it should give you a better error message.

@tonyaw
Copy link

tonyaw commented Nov 15, 2022

@spalger It prints detail info. Thanks! :-)
Could you please help to provide how do you know to change https://github.com/elastic/kibana/blob/main/packages/kbn-ui-shared-deps-npm/webpack.config.js#L32?
The code I'm changing is under "src/plugins" directory. I also tried to put my plugin under "plugins" directory. The result is same.

@spalger
Copy link
Contributor

spalger commented Nov 15, 2022

You won't be able to make this change permanently for now, but it should the default soon. For now, please just update the value when you need it and/or keep a temporary change locally.

@tonyaw
Copy link

tonyaw commented Nov 16, 2022

Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Operations Team label for Operations Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants