Meteor 1.12 Release!

Hey all!

We have some really exciting updates for you on Meteor 1.12, and the major one is Typescript 4.1.2 with Decorators and Metadata Reflection .

Other key updates:

  • facebook-oauth@1.7.3 — Is now using Facebook GraphAPI v8
  • browser-content-policy@1.1.1 — Adds support for nonce
  • dynamic-import@0.5.4 — Fixes prefetch errors
  • meteor-tool@1.12 — supports Cordova add plugin command working again with plugin id or plugin name in the git URL as it was before Meteor 1.11
  • minimongo@1.6.1 — fixes a null reference exception, if an array contains null values while compiling a fields projection.

For full details on the release, see our release notes.

Let me know if you have any questions!

-Elysse

18 Likes

Edit: looks like I’m not alone on this one. Someone else opened an issue a few hours ago: https://github.com/meteor/react-packages/issues/307


Getting this error right after updating. Will dig deeper later today.

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

The above error occurred in the <ForwardRef> component:
    at http://0.0.0.0:3000/packages/react-meteor-data.js?hash=085e11d486d61b046c1711ec1d5bf34be9d73759:397:20

If I dig into the specific part of the code throwing the error, it’s the one starting with const data:

function withTracker(options) {
  return Component => {
    const getMeteorData = typeof options === 'function' ? options : options.getMeteorData;
    const WithTracker = /*#__PURE__*/forwardRef((props, ref) => {
      const data = useTracker(() => getMeteorData(props) || {}); // THIS LINE CAUSING ISSUES
      return /*#__PURE__*/React.createElement(Component, _extends({
        ref: ref
      }, props, data));
    }); // @ts-ignore

    const {
      pure = true
    } = options;
    return pure ? /*#__PURE__*/memo(WithTracker) : WithTracker;
  };
}

I believe react-meteor-data is currently @2.1.3 on my system.

Hi @elysse, on the changelog page on the Meteor website and in the Github History.md file, the v1.12 release date has been entered incorrectly.

It should read v1.12, 2020-12-04 instead of v1.12, 2020-04-12.

2 Likes

Hi @jasongrishkoff, what is your react version?

Also getting this error. Using the withTracker() version of react-meteor-data

Using react 17.0.1

The same error, React @16.14.0

Fixed with react-meteor-data upgraded from 2.1.3 to 2.1.4
Thanks @renanccastro for the instant fix.

5 Likes

Hi @jasongrishkoff - We had @renanccastro resolve this, but if you see any other issues, let me know and I’ll happily relay it to our team!

1 Like

@rjdavid Our team has resolved this, but please let me know if you encounter any other issues.

Hi @vlasky! Our team has resolved this, however, please let me know if you encounter any other issues. I’ll gladly relay it to our team.

1 Like

Confirming the fix in react-meteor-data 2.1.4

1 Like

Not really sure how this happened:

   While selecting package versions:
   error: No version of dynamic-import satisfies all constraints: @0.5.4, @=0.5.2, @~0.5.4
   Constraints on package "dynamic-import":
   * dynamic-import@0.5.4 <- top level
   * dynamic-import@=0.5.2 <- top level
   * dynamic-import@~0.5.4 <- top level
   * dynamic-import@0.5.4 <- ecmascript 0.14.4
   * dynamic-import@0.5.4 <- typescript 4.1.2

I think hard links to specific versions in package.js would be avoided. For example, https://github.com/meteor/react-packages/blob/910bd19f8564ba02a7c680921fb5964e02508580/packages/react-meteor-data/package.js#L15

That should probably be changed to:

Package.onUse(function (api) {
  api.versionsFrom(['1.8.2', '1.12']);  // use versionsFrom with a range instead of hard links on individual packages
  api.use('tracker');
  api.use('ecmascript');
  api.use('typescript');

  api.mainModule('index.js', ['client', 'server'], { lazy: true });
});

In the cases of typescript and ecmascript there’s actually no reason a package which uses those should pull them in to the consumer’s project, since they are compile time packages. I’m not sure how that’s resolved by meteor.

1 Like

I just want to hopefully poke someone here that the blog post says

You can update your Meteor project to 1.11 now running meteor update inside your project folder.

Copy-paste errors happen to the best of us.

https://blog.meteor.com/meteor-1-12-is-here-ec0c78dbb973

Getting the dynamic-import error on new projects even after re-installing Meteor. Any ideas?

➜  examples-new meteor create parties
=> Errors while creating your project         
                                              
While selecting package versions:
error: No version of dynamic-import satisfies all constraints: @=0.5.2, @~0.5.4
Constraints on package "dynamic-import":
* dynamic-import@=0.5.2 <- top level
* dynamic-import@~0.5.4 <- top level
* dynamic-import@0.5.4 <- ecmascript 0.14.4
* dynamic-import@0.5.4 <- typescript 4.1.2

When you have multiple top level constraints, the exact (@=) constraint is usually caused by having a local package. Check if any of the folders in the METEOR_PACKAGE_DIRS env var contains a dynamic-import package.