minhna
December 7, 2020, 4:13pm
1
I’m building an app with meteor 2.0-beta.4 with
react-meteor-data@2.1.2
"react": "^16.13.1"
App structure
import { App } from '/imports/ui/App';
file: imports/ui/App.jsx
:
import { AccountProvider } from '/imports/ui/contexts/account-context.js'
// ...
export const App = () => {
file: imports/ui/contexts/account-context.js
import { useTracker } from 'meteor/react-meteor-data'
// ...
export const AccountProvider = (props) => {
Error:
Uncaught Error: Cannot find module '/node_modules/meteor/react-meteor-data/index.js'
Weird solution:
add the importing useTracker file to the App.jsx file (Unused)
file: imports/ui/App.jsx:
import { useTracker } from 'meteor/react-meteor-data'
// ...
import { AccountProvider } from '/imports/ui/contexts/account-context.js'
Do you have any better solution? Should I create an issue in github?
minhna
December 8, 2020, 9:41am
2
it’s something about react Suspense/lazy
.
I created a repository at https://github.com/minhna/meteor-2.0-beta.4-react-error
minhna
December 8, 2020, 9:53am
3
I also created a version with meteor 1.12. It works without any problem.
minhna
December 8, 2020, 9:57am
4
@captainn , @filipenevola do you have any idea?
There was a mishap with a recent publish - I think we’re up to version react-meteor-data@2.1.4
- try updating and see if it fixes you up.
minhna
December 9, 2020, 2:22am
6
I tried but I don’t know how to update/install version 2.1.4. Meteor says the last compatible is 2.1.2.
I tried to add --allow-incompatible-update but it didn’t work either.
meteor add react-meteor-data@2.1.4
=> it installed 2.1.2
meteor update react-meteor-data --allow-incompatible-update
=> still 2.1.2
minhna
December 9, 2020, 3:18am
8
I tried, it doesn’t work. 2.1.2 is the only option.
I tried to create new project and 2.1.2 is still the only option.
Do you have a custom babel resolver set up? The specific error you are getting is odd:
Uncaught Error: Cannot find module '/node_modules/meteor/react-meteor-data/index.js'
Why is it looking in node_modules
for a package that starts with meteor/
?
minhna
December 9, 2020, 3:12pm
10
Yes, I know, that’s weird. I didn’t do any special. You can check my github repository above.
This looks like an issue with the module system. You’ll probably need to get someone familiar with that to look at this. I don’t think it’s a react-meteor-data
issue.
You could try putting a local copy of the react-meteor-data
in your packages folder though. Maybe test this PR .
1 Like
minhna
December 9, 2020, 3:33pm
12
Thank you, I will try the local copy of react-meteor-data idea.
I wonder if this has anything to do with it:
No, probably not. This would only apply if appcache
was enabled.
committed 08:22PM - 11 Nov 20 UTC