DRAFT: fix build-production issue
I've been digging into this cryptic error message with running pnpm build-production on the new action-bar project.
ERROR in action-bar.js:1:7642: msgid argument is not a string literal: _.__(C,e)
I couldn't find any clues from the error message itself or any help from google, but I did narrow it down to being caused whenever any member function of preact is called. So for example, this code will trigger it:
import { render } from 'preact';
console.log( render );
I found that the search package is already including preact successfully, and by process of elimination found two things that are neccessary to run pnpm build-production without errors:
Firstly, we need to load the entry point via a loader script, I found that it can be as simple as require( 'action-bar.jsx' );
Secondly, we need to import something from 'react-redux'. I worked this out by elimination and have no idea why it is necessary.
With this change however, we can successfully run pnpm build-production. I'd invite you @creativecoder, @eoigal (or @jeherve if you want a riddle to solve) to try and work out what's happening here
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: All commits were linted before commit.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :red_circle: Add testing instructions.
- :red_circle: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
:red_circle: Action required: Please include detailed testing steps, explaining how to test your change, like so:
#### Testing instructions:
* Go to '..'
*
:red_circle: Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:
#### Does this pull request change what data or activity we track or use?
My PR adds *x* and *y*.
Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.
Jetpack plugin:
- Next scheduled release: September 6, 2022.
- Scheduled code freeze: August 30, 2022.
Thanks for this @roo2 ! Feel free to merge it directly into #25447, if you'd like.
@jsnmoon Does this ring a bell? Did you run into issues like this when you first built the infrastructure for Instant Search?