Closed zedd45 closed 2 months ago
Looks like I had a typo in my search, at least on this repo. I found #17, which was filed by my coworker, but doesn't address this specific problem, unless I accidentally wrapped something dynamic in <FormatMessage>
. I'll post back if my removing sections of the code troubleshooting bears fruit.
Ok, I found it. We had some code my aforementioned coworker had written that took options, and I tried to extract that to a Global Constant for use elsewhere in the codebase (I was trying to directly utilize Globalize
to format a number that's being passed to another, 3rd party react component over which I do not have control).
So in the course of refactoring, I tried to change the input to <FormatNumber>
, and he had even left a comment about how this cannot be dynamic, which I overlooked when I made this change 🤕
<FormatNumber options={NUMBER_FORMAT_OPTIONS}>
{number}
</FormatNumber>
I see you made progress on your search. Please, do you still need any input? Did you find a bug? Thanks
I'm not sure where the stack trace originates from, but this error seems to be related to trying to use an object reference for <FormatNumber>
versus a "hard coded" object in the props. If I understand correctly, this may be related to globalize-compiler
reads the files and generates replacement code?
I have solved the problem in our code base by replacing the reference with an object literal containing the option values, so we can close this, but I would have two questions:
react-globalize
. Is this the case? Will it always be the case? It makes it a little harder to work with. For instance, I'm working on a bread crumb feature now, and I cannot simply take the displayName
of the component and drop that into <FormatMessage>
, either, because the children
special prop gets read & replaced, right?
I added some code with a recent commit, and Globalize Compiler will no longer complete a production build.
Unfortunately, the error seems a bit cryptic for me to decipher. I tried searching this repo and it's predecessor (rxaviers/globalize-webpack-plugin) for
ReferenceError
or another sign of this problem, but it looks like that message may be coming from a dependency, or I was simpy unable to turn up results as I expected.The error I'm getting tells me
_
isn't defined, but doesn't go into detail about where this error actually originates from in the code. I'm a bit stumped, and I've started removing the code from the commit (rolling back to the previous commit fixes it), but I've not had much success with this method, either.Here's the error:
Any insight is much appreciated!