Omnistac / zedux

:zap: A Molecular State Engine for React

Home Page:https://Omnistac.github.io/zedux/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`generateReactComponentId` fails in Firefox while browsing CodeSandbox examples

cswendrowski opened this issue · comments

While checking out the example pages, I get the following error in Firefox (but not Chrome):

TypeError
can't access property "toUpperCase", fn[0] is undefined
generateReactComponentId/_a<@https://b5upgd.codesandbox.io/node_modules/
zedux/react/dist/cjs/classes/IdGenerator.js:83:13
generateReactComponentId@https://b5upgd.codesandbox.io/node_modules/
zedux/react/dist/cjs/classes/IdGenerator.js:78:14
useReactComponentId/<@https://b5upgd.codesandbox.io/node_modules/
zedux/react/dist/cjs/hooks/useReactComponentId.js:16:62
mountMemo
https://b5upgd.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:17225:19

The Live Sandbox examples in the docs work fine, however: https://omnistac.github.io/zedux/docs/walkthrough/quick-start

A bit of triage indicates that it's likely because DEV mode is on while in Firefox in CodeSandbox, although I wasn't able to glean insights into why

commented

Yoo thanks for reporting @cswendrowski!

Looks like this is gonna be due to SpiderMonkey generating stack traces a little differently. TMK Zedux hasn't been tested at all yet in anything but V8. In theory, everything should be cross-platform compatible. This generateReactComponentId code is definitely an exception - it does some hacky stuff in DEV to figure out a human-readable identifier for the graph.

I'll get a fix for this today and will definitely try to get examples running on SpiderMonkey and JavaScriptCore at least soon - just to make sure there's nothing else.