Meteor 3.4 without Rspack

Hello,

I’m attempting to upgrade from 3.3.2 to 3.4. I’m encountering some difficulties with older Meteor packages when using Rspack, which I’m working to resolve with Claude (for example, patched bootstrap 3, patched znewsham:dynamic-table).

While working on these issues, I noticed that if I don’t run meteor add rspack, I can still compile successfully using the SWC compiler and linker without Rspack.

Is it possible to operate this way transitionally in production in order to benefit from the latest Node version and framework fixes?

Thank you for your response.

Best regards,
Bruno

Definitely. You can update to 3.4, and also upcoming versions like 3.4.1 or 3.5 (and so on), without opting into Rspack at all, and keep using the Meteor bundler, with or without SWC.

This has been the idea from the beginning: let Meteor users benefit from improvements and fixes in each release, while always giving them a path to migrate to modern tools when they decide it is time.

1 Like

How can we disable/opt out from rspack in Meteor 3.4?
Is there a guide we can follow?
I tried by just removing the rspack package (and all the build folders) but that leaves our application in a broken state, unable to resolve installed node modules at startup, so something more is definitely required to have Meteor go back to the old bundler.

As an example, at startup we’re seeing “Unable to resolve some module” errors related to packages with subpath exports; an example: js-tiktoken:

  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "require": "./dist/index.cjs",
      "default": "./dist/index.js"
    },
    "./lite": {
      "types": "./dist/lite.d.ts",
      "require": "./dist/lite.cjs",
      "default": "./dist/lite.js"
    },
    ...etc...

It looks like packages like this one are not resolvable anymore in Meteor 3.4 if we opt out of rspack…

The major issue we’re having with Rspack is that any change in the server side code results in the browser erroring out:

This makes local development a real pain, hence the idea to go back to the old bundler… but it doesn’t seem to be that easy…

It’s hard to go back to the Meteor bundler in Meteor 3.4 if you rely on bundler features that aren’t enabled there.

It looks like you have a dependency that uses the ‘exports’ field in package.json. That isn’t supported by the legacy Meteor bundler. The Meteor-Rspack integration is the way to modernize and support that for Meteor apps, along with many other bundler features.

If you start using Rspack and later opt out, keep in mind those bundler features will be disabled or may stop working on the legacy bundler.

The alternative is to add each missing feature to the legacy bundler, which is intensive work and not something we have capacity, not either our direction. We did have a PR open for a long time to address this exact limitation (support ‘exports’ field):

That PR hasn’t progressed enough to be included. And with less time than that PR is open, we have unlocked all modern bundler features possibilities with the Rspack integration. Meteor core direction is toward modern tools and delegation. The Rspack integration unlocks modern bundler benefits, not only features but also build speed.

If your app works with Rspack, what makes you want to opt out? Any feedback you can share to improve Meteor-Rspack integration?

Thanks @nachocodoner for your input, it’s really appreciated.
We found a way to make this work. As always happens, the issue was mainly on our side, since we have a monorepo on which we launch 3 separate instances of Meteor servers (sharing the same codebase); that was, as expected, not playing well with Rspack and its cache folder.
We have it working now and it seems working well, so fingers crossed we won’t see more issues!

1 Like

Oh, good to know another use case for running several instances of a Meteor app from the same codebase.

We got this report recently as well. Is that same use case than you? Thanks for any further details.

I’ve already taken notes and plan to include a fix for running multiple Meteor apps from the same folder in the Meteor 3.4.1 patch.

Eheh, actually it’s the same project, that was our Head of Engineering posting there :smile:

1 Like