Closed yaser-alazm closed 2 years ago
Any recommendations ?
It looks like configuration is fine, import statement is fine - not sure what's going on there. You do have an error in your useTracker block, but that would cause a different problem:
const tasks = useTracker(() => {
Tasks.find({}).fetch();
}, []);
You need to return that value:
const tasks = useTracker(() => {
return Tasks.find({}).fetch();
}, []);
@CaptainN I already consider this to cause this issue, but still no luck! I think it's something to deal with the packages version.
app.js:10 Uncaught TypeError: useTracker is not a function
at App (app.js:10)
at renderWithHooks (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:17217)
at mountIndeterminateComponent (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:19299)
at beginWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:19904)
at performUnitOfWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23591)
at workLoop (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23631)
at HTMLUnknownElement.callCallback (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4428)
at Object.invokeGuardedCallbackDev (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4478)
at invokeGuardedCallback (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4535)
at replayUnitOfWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:22857)
App @ app.js:10
renderWithHooks @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:17217
mountIndeterminateComponent @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:19299
beginWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:19904
performUnitOfWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23591
workLoop @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23631
callCallback @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4428
invokeGuardedCallbackDev @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4478
invokeGuardedCallback @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4535
replayUnitOfWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:22857
renderRoot @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23747
performWorkOnRoot @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24621
performWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24533
performSyncWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24507
requestWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24376
scheduleWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24190
scheduleRootUpdate @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24851
updateContainerAtExpirationTime @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24879
updateContainer @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24936
ReactRoot.render @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25232
(anonymous) @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25369
unbatchedUpdates @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24738
legacyRenderSubtreeIntoContainer @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25365
render @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25434
(anonymous) @ main.js:7
maybeReady @ meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:938
loadingCompleted @ meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:950
modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:21396 The above error occurred in the <App> component:
in App
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:21396
logError @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:21432
update.callback @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:22344
callCallback @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:20712
commitUpdateEffects @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:20751
commitUpdateQueue @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:20742
commitLifeCycles @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:21662
commitAllLifeCycles @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23015
callCallback @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4428
invokeGuardedCallbackDev @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4478
invokeGuardedCallback @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:4535
commitRoot @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23227
(anonymous) @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24697
unstable_runWithPriority @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25889
completeRoot @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24696
performWorkOnRoot @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24625
performWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24533
performSyncWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24507
requestWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24376
scheduleWork @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24190
scheduleRootUpdate @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24851
updateContainerAtExpirationTime @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24879
updateContainer @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24936
ReactRoot.render @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25232
(anonymous) @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25369
unbatchedUpdates @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24738
legacyRenderSubtreeIntoContainer @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25365
render @ modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:25434
(anonymous) @ main.js:7
maybeReady @ meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:938
loadingCompleted @ meteor.js?hash=857dafb4b9dff17e29ed8498a22ea5b1a3d6b41d:950
modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24591 Uncaught TypeError: useTracker is not a function
at App (app.js:10)
at renderWithHooks (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:17217)
at mountIndeterminateComponent (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:19299)
at beginWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:19904)
at performUnitOfWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23591)
at workLoop (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23631)
at renderRoot (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:23714)
at performWorkOnRoot (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24621)
at performWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24533)
at performSyncWork (modules.js?hash=2ce9e30d3ad145e79ef810b20822af1327a19f4b:24507)
Maybe try meteor reset
- it's definitely a strange error...
meteor reset
No luck unfortunately!
@benjamn @grigio @glasser can you check this out please ?
Sorry, I don't work on Meteor these days!
Maybe ask in the Meteor Forums. I don't know what's going on here.
Hi @yaser-alazem, could you provide a reproduction? 😉
Read more here
We have many projects using react-meteor-data
so it must be something different in your project.
Maybe you are using an old version of Meteor with an old version of react-meteor-data
? useTracker is only available in newer versions.
I'm closing this issue because we haven't heard anything from the original poster for a while.
Hello.
It's my first time trying to work around with Meteor, so I have this project already created, I cloned the repo to my local and started to play around with it.
But I'm stuck with this error (Uncaught TypeError: useTracker is not a function!) every time trying to fetch data.
In the main.js on the server I'm trying to connect to the database and add some data:
in the Tasks.js file there is the creation on tasks collection and it's schema :
In the ui/app.js I just try to use useTracker to fetch the data, in the app.js :
this is the .meteor/packages file content
The package.json content :