Closed markoambrozic closed 5 years ago
This was run on a slightly modified project but it should happen on the original also. I've managed to track down the problem to the 'informed' package: import { Form } from 'informed'; - if this is removed and also the Form wrapper in the render function, the project will build but the page will have other issues.
Thanks for reporting the problem! I will look into the issue and check if i can reproduce.
One more piece of information... I've been able work around this problem by removing the informed package from webpack config split chunks optimization list. This then causes the following error:
Uncaught TypeError: Cannot read property 'controller' of undefined
at eval (index.js?e051:formatted:295)
at updateContextConsumer (react-dom.development.js?61bb:15278)
at beginWork (react-dom.development.js?61bb:15466)
at performUnitOfWork (react-dom.development.js?61bb:19106)
at workLoop (react-dom.development.js?61bb:19146)
at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:149)
at Object.invokeGuardedCallbackDev (react-dom.development.js?61bb:199)
at invokeGuardedCallback (react-dom.development.js?61bb:256)
at replayUnitOfWork (react-dom.development.js?61bb:18372)
at renderRoot (react-dom.development.js?61bb:19262)
(anonymous) @ index.js?e051:formatted:295
updateContextConsumer @ react-dom.development.js?61bb:15278
beginWork @ react-dom.development.js?61bb:15466
performUnitOfWork @ react-dom.development.js?61bb:19106
workLoop @ react-dom.development.js?61bb:19146
callCallback @ react-dom.development.js?61bb:149
invokeGuardedCallbackDev @ react-dom.development.js?61bb:199
invokeGuardedCallback @ react-dom.development.js?61bb:256
replayUnitOfWork @ react-dom.development.js?61bb:18372
renderRoot @ react-dom.development.js?61bb:19262
performWorkOnRoot @ react-dom.development.js?61bb:20136
performWork @ react-dom.development.js?61bb:20048
performSyncWork @ react-dom.development.js?61bb:20022
requestWork @ react-dom.development.js?61bb:19891
scheduleWork @ react-dom.development.js?61bb:19705
enqueueSetState @ react-dom.development.js?61bb:11141
Component.setState @ react.development.js?cb92:335
setRouteComponent @ MagentoRouteHandler.js?8b9b:213
_callee2$ @ MagentoRouteHandler.js?8b9b:171
tryCatch @ runtime.js?36d8:62
invoke @ runtime.js?36d8:288
prototype.(anonymous function) @ runtime.js?36d8:114
asyncGeneratorStep @ asyncToGenerator.js?ae7e:3
_next @ asyncToGenerator.js?ae7e:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js?ae7e:13
_next @ asyncToGenerator.js?ae7e:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js?ae7e:13
_next @ asyncToGenerator.js?ae7e:25
(anonymous) @ asyncToGenerator.js?ae7e:32
(anonymous) @ asyncToGenerator.js?ae7e:21
getRouteComponent @ MagentoRouteHandler.js?8b9b:195
componentDidMount @ MagentoRouteHandler.js?8b9b:104
commitLifeCycles @ react-dom.development.js?61bb:17128
commitAllLifeCycles @ react-dom.development.js?61bb:18530
callCallback @ react-dom.development.js?61bb:149
invokeGuardedCallbackDev @ react-dom.development.js?61bb:199
invokeGuardedCallback @ react-dom.development.js?61bb:256
commitRoot @ react-dom.development.js?61bb:18742
(anonymous) @ react-dom.development.js?61bb:20212
unstable_runWithPriority @ scheduler.development.js?3069:255
completeRoot @ react-dom.development.js?61bb:20211
performWorkOnRoot @ react-dom.development.js?61bb:20140
performWork @ react-dom.development.js?61bb:20048
performSyncWork @ react-dom.development.js?61bb:20022
requestWork @ react-dom.development.js?61bb:19891
scheduleWork @ react-dom.development.js?61bb:19705
scheduleRootUpdate @ react-dom.development.js?61bb:20366
updateContainerAtExpirationTime @ react-dom.development.js?61bb:20394
updateContainer @ react-dom.development.js?61bb:20451
ReactRoot.render @ react-dom.development.js?61bb:20747
(anonymous) @ react-dom.development.js?61bb:20884
unbatchedUpdates @ react-dom.development.js?61bb:20253
legacyRenderSubtreeIntoContainer @ react-dom.development.js?61bb:20880
render @ react-dom.development.js?61bb:20949
(anonymous) @ index.js?b635:37
./src/index.js @ client.js:8964
__webpack_require__ @ client.js:789
fn @ client.js:150
0 @ client.js:8977
__webpack_require__ @ client.js:789
checkDeferredModules @ client.js:46
(anonymous) @ client.js:930
(anonymous) @ client.js:933
react-dom.development.js?61bb:16911 The above error occurred in the <Context.Consumer> component:
in ForwardRef
in Select (created by Classify(Select))
in Classify(Select)
in div
in Quantity (created by Classify(Quantity))
in Classify(Quantity) (created by ProductFullDetail)
in section (created by ProductFullDetail)
in ErrorBoundary (created by ProductFullDetail)
in form (created by Form)
in Form (created by ProductFullDetail)
in ProductFullDetail (created by Classify(ProductFullDetail))
in Classify(ProductFullDetail)
in Query
in Product
in Connect(Product)
in MagentoRouteHandler
in Page
in Route
in Switch
in div
in main
in Main (created by Classify(Main))
in Classify(Main)
in App
in Connect(App)
in Route
in Router
in BrowserRouter
in MagentoRouter
in Provider
in ApolloProvider
in VeniaAdapter
React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
By adding an ErrorBoundary around the Quantity field we are now able to develop everything else.
So i've tried to reproduce the problem but i've just updated Fallback Studio to be compatible with PWA studio v2.1.0 and i'm not able to reproduce the issue now. As you can see below i copied the suggested file and the needed layz loaded component. You might wanna upgrade to the newest Fallback Studio. This also support graphql schema checking.
Hi,
I've realized yesterday that the TypeError: Cannot read property 'controller' of undefined
is sometimes due to a component (select BTW) not included in a<form>
tag
cheers
Sounds like this isn't a fallback issue but more an issue from PWA Studio itself or a self created issue. Can you conform this ?
Hi,
this issues occurs when I try to modify the ProductFullDetail component.
Steps to reproduce: