Amazing! Very excited for the future of Meteor
I get
import { defineConfig } from '@meteorjs/rspack';
^^^^^^
SyntaxError: Cannot use import statement outside a module
when I try to run it. Is type:“module”
needed in the package.json? Just asking, because it is also not set when I create a new app with the template.
The main problem I am still having is changing the rspack config file doesn’t seem to always invalidate the cache. So I have to remove _build a lot when trying to debug rspack issue. It really slows down my ability to figure out my issues.
You don’t need to use "type": "module"
in package.json
. If you remove it, does it work? If for some reason you need it, I’d appreciate a minimal repository that reflects your setup, and why you need it. That way I can test it directly and explore possible extensions.
By default, the cache is enabled to improve development speed on rebuilds. If you ever need to disable it, you can override your rspack.config.js
to prevent any cache from being used. You can also force files to be regenerated on every build. For example:
export default defineConfig(Meteor => {
return {
output: {
clean: true // deletes old files in _build before emitting
},
cache: false, // disable cache
experiments: {
cache: false // disable persistent cache (experimental flag)
}
};
});
With this config, cache is completely disabled and files re-emitted. Test if this improves the experience.
To ensure strict cleaning, it now happens as part of meteor reset
, this should be enough for all sorts of cache cleaning. Alternatively, you can use plugins to wipe the build directory, node_modules/.cache, .meteor/local, for instance, clean-webpack-plugin
. Or you can simply run rm -rf _build
(or rimraf _build
using npm package) before your meteor run
process. Creating an npm script for this can make it easier to automate.
Explore what works best for you to keep rspack.config.js
changes refreshing properly. We may improve cache cleaning in meteor reset
if needed, or allow automatic cache disabling through an env variable, making it easier for those who do frequent config changes.
About rspack.config.js file, Rspack does not auto-reload when you edit rspack.config.js
, similarly as webpack’s behavior, so we can’t get sort out the need to restart the app manually.
Thanks for the info!
I was able to finally get my app to launch.
Random things that tripped me up that may help other people.
I have a package “@react-native-async-storage/async-storage” that is ill-formed so I had to do an alias that directly mapped to a file
"@react-native-async-storage/async-storage": [
path.resolve(__dirname, "./node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage"),
],
One of my packages uses a .node binary so I had to add this rule:
module: {
rules: [
{
test: /\.node$/,
type: "asset/resource",
},
The thing that tripped me up is there is a webpack package node-loader that is deprecated. That does not work with meteor so you have to use the asset/resource
I had an ill behaving package that had jsx in js file and had to add this:
{
test: /\.js$/, // Target .js files
use: {
loader: "builtin:swc-loader",
options: {
jsc: {
parser: {
syntax: "ecmascript",
jsx: true, // Enable JSX parsing for JavaScript files
},
},
},
},
},
My layout.html was not next to my client entry file, so it was not automatically loaded. I had to move my layout.html to the correct folder and then it worked fine.
I haven’t tested the testing infrastructure or really any usage of this, but the speed improvements are pretty big and I’m excited for this to be stabilized.
I tried running unit tests and it looks like this is loading too many files.
I have folders that the tool should ignore that its including, causing rspack to completely crash.
I think the eager-tests.js needs to respect the .meteorignore file for my project to work.
Yeah, we usually do not use that parameter within our Meteor applications. But after uprading it to Beta 8, the app crashes with the error:
[Rspack Client Error] /var/project/rspack.config.js:1
import { defineConfig } from '@meteorjs/rspack';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I guess it is because the created config files uses the import syntax.
When emptying the whole file, the app seems to build but crashes with:
ReferenceError: $RefreshSig$ is not defined
Woo! Windows is fixed! Thanks!
Deploy still not working though :(.
Preparing to upload your app...
Uploaded app bundle to upgrade todo-sample.meteorapp.com to version 3.
Galaxy is building the app into a native image.
Waiting for deployment updates from Galaxy...
Building app image...
Deploying app...
******************************************************************************
ERROR: Failed to deploy new app version: 3.
Galaxy failed to deploy your app. The final deploy status was: Deploy Failed.
Your app is currently stopped.
See https://galaxy.meteor.com/app/todo-sample.meteorapp.com/logs for details.
******************************************************************************
The galaxy logs show this:
8fg4j
2025-09-11 22:23:53-07:00Error: MONGO_URL must be set in environment
8fg4j
2025-09-11 22:23:53-07:00 at Object.<anonymous> (packages/mongo/remote_collection_driver.ts:113:11)
8fg4j
2025-09-11 22:23:53-07:00 at Object.defaultRemoteCollectionDriver (/app/bundle/programs/server/npm/node_modules/meteor/mongo/node_modules/lodash.once/index.js:71:21)
8fg4j
2025-09-11 22:23:53-07:00 at setupDriver (packages/mongo/collection/collection_utils.js:29:27)
8fg4j
2025-09-11 22:23:53-07:00 at new Collection (packages/mongo/collection/collection.js:52:18)
8fg4j
2025-09-11 22:23:53-07:00 at AccountsServer._initializeCollection (packages/accounts-base/accounts_common.js:114:20)
8fg4j
2025-09-11 22:23:53-07:00 at new AccountsCommon (packages/accounts-base/accounts_common.js:62:23)
8fg4j
2025-09-11 22:23:53-07:00 at new AccountsServer (packages/accounts-base/accounts_server.js:31:5)
8fg4j
2025-09-11 22:23:53-07:00 at module.wrapAsync.self (packages/accounts-base/server_main.js:7:12)
8fg4j
2025-09-11 22:23:53-07:00 at Module.wrapAsync (/app/bundle/programs/server/npm/node_modules/meteor/modules/node_modules/@meteorjs/reify/lib/runtime/index.js:252:8)
8fg4j
2025-09-11 22:23:53-07:00 at module (/app/bundle/programs/server/packages/accounts-base.js:33:9)
8fg4j
2025-09-11 22:23:53-07:00 at fileEvaluate (packages/modules-runtime.js:335:7)
8fg4j
2025-09-11 22:23:53-07:00 at Module.require (packages/modules-runtime.js:237:14)
8fg4j
2025-09-11 22:23:53-07:00 at Module.mod.require (/app/bundle/programs/server/npm/node_modules/meteor/modules/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
8fg4j
2025-09-11 22:23:53-07:00 at Object.require (packages/modules-runtime.js:257:21)
8fg4j
2025-09-11 22:23:53-07:00 at evaluateNextModule (packages/core-runtime.js:167:26)
8fg4j
2025-09-11 22:23:53-07:00 at runEagerModules (packages/core-runtime.js:206:3)
8fg4j
2025-09-11 22:23:53-07:00
8fg4j
2025-09-11 22:23:53-07:00Node.js v22.18.0
Why would I need to set MONGO_URL when deploying to Galaxy?
Worked for me each time I deployed your shared project.
This is the command that I run for deploy. Maybe you need to establish to create a free mongo for your free app.
meteor deploy meteor-rspack-starter.meteorapp.com --owner <my-username> --free --mongo
Hey, great that you got it working. Depending on the project you may need extra config. Thanks for sharing your specifics.
For everyone: import aliases need to be migrated to the Rspack approach. I’ve documented this in the docs.
About loaders: a loader config lets your bundler import specific file types. For Less files use less-loader; for Markdown files use markdown-loader; many others exist. For .node binaries, this is deprecated in favor of asset/resource. asset/resource can also handle images and more as a built-in feature. Learn more in the Rspack asset modules docs.
About moving layout.html
near the entry point so Meteor processes it: this is now required. Similarly for CSS files. If you must keep the original path and still have Meteor process them automatically, use the new modules fields in meteor package.json. I still recommend keeping all HTML and CSS that Meteor should process near the entry point so it can skip expensive scans elsewhere. It is preferable to let Rspack handle these, especially CSS files that can be imported in code and resolved automatically. Still, you can rely on Meteor’s eager mechanism for HTML and CSS, which is also a valid and working approach.
In the next beta phase, I will see if I can improve the eager mechanism for loading tests. I’ll also try to ensure entries in .meteorignore are discarded. Remember you can rely on testModule and provide a manual index file for all your tests. Anyway, I will optimize eager mode in the next releases.
While developing on windows, for some reason HMR can sometimes crash the rspack server and then when refreshing the browser (3000) it’s just a white page and can’t connect.
=> Client modified -- refreshing (x3)[Rspack Server] [server-rspack]:
[server-rspack] compiled successfully in 38 ms
=> Client modified -- refreshing (x4)
[Rspack Client Error] node:events:496
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:216:20)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}
Node.js v22.18.0
I20250913-14:20:05.922(-7)? Server startup - Starter Todo App
=> Meteor server restarted at: http://localhost:3000/[Rspack Server] [server-rspack]:
[server-rspack] compiled successfully in 33 ms
=> Client modified -- refreshing
node:internal/child_process:877
const ex = new ErrnoException(err, 'write');
^
Error: write EPIPE
at ChildProcess.target._send (node:internal/child_process:877:20)
at ChildProcess.target.send (node:internal/child_process:751:19)
at packages/inter-process-messaging.js:171:24
at new Promise (<anonymous>)
at packages/inter-process-messaging.js:168:16
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at refreshClient (C:\tools\runners\run-app.js:848:7) {
errno: -4047,
code: 'EPIPE',
syscall: 'write'
}
Node.js v22.18.0
Killing the server and restarting brings everything back up fine.
Those updates have some great vibes from 2013
Hoping for Meteor to become a bleeding edge tech once again, thanks guys
I do not agree, “low priority” — yes, “leave it as it is” — no
I’ve ran into an issue of local package not being recognized:
W20250915-16:00:12.079(2)? (STDERR) packages/core-runtime.js:189
W20250915-16:00:12.079(2)? (STDERR) throw error;
W20250915-16:00:12.079(2)? (STDERR) ^
W20250915-16:00:12.079(2)? (STDERR)
W20250915-16:00:12.079(2)? (STDERR) Error: Cannot find package "lu-intl". Try "meteor add lu-intl".
W20250915-16:00:12.079(2)? (STDERR) at makeInstallerOptions.fallback (packages/modules-runtime.js:704:13)
W20250915-16:00:12.079(2)? (STDERR) at Module.require (packages/modules-runtime.js:243:14)
W20250915-16:00:12.080(2)? (STDERR) at Module.mod.require (/home/storyteller/.meteor/packages/modules/.0.20.3.1l9ud9l9blw++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
I have the package added and in the packages directory, but still get this error. Did I miss something?
In the meantime I’ll go fix the other errors which are due to symbolic links and missing few files as a result.
Oh, is the local package in ./packages
folder? Or do you set METEOR_PACKAGE_DIRS
? In which way you set it?
I did changes to ensure these dirs for local packages are recognized still by Meteor, but maybe I have some edge case to cover yet.
./packages
folder is what I use.
Hey my friend @nachocodoner.
I don’t use nested imports in this project - it’s a relatively small project and always uses the latest Meteor. I also tried to read all the docs and installed meteor add rspack
.
For context: It’s a small project to binge YouTube channels https://binge.quave.dev. I’m probably the only user hehe. It’s 100% made by AI - I’m testing Cursor and Claude configurations to code in Meteor like we do at Quave. It’s already working well in many cases. We’ll open-source it once it’s done, and we already have something published in our meteor-template (Claude.md and agents), but I’m not updating there all the time since I’m working on the Binge repo.
I’m stuck on this step and I’ve tried twice:
➜ web git:(main) ✗ meteor npm start
> start
> MONGO_URL=mongodb://localhost:27017/binge-ai meteor --settings private/env/dev/settings.json
[[[[[ ~/Documents/quave/ws/binge/web ]]]]]
=> Started proxy.
=> Started HMR server.
[Rspack Server Error] Error: config file "/Users/filipe/Documents/quave/ws/binge/web/node_modules/@meteorjs/rspack/rspack.config.js" not found.
at loadRspackConfig (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:658:75)
at RspackCLI.loadConfig (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:796:34)
at RspackCLI.createCompiler (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:680:50)
at Object.handler (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:284:44)
at /Users/filipe/Documents/quave/ws/binge/node_modules/yargs/build/index.cjs:1:8993
at j (/Users/filipe/Documents/quave/ws/binge/node_modules/yargs/build/index.cjs:1:4956)
at _.handleValidationAndGetResult (/Users/filipe/Documents/quave/ws/binge/node_modules/yargs/build/index.cjs:1:8962)
at _.applyMiddlewareAndGetResult (/Users/filipe/Documents/quave/ws/binge/node_modules/yargs/build/index.cjs:1:9604)
at _.runCommand (/Users/filipe/Documents/quave/ws/binge/node_modules/yargs/build/index.cjs:1:7231)
at [runYargsParserAndExecuteCommands] (/Users/filipe/Documents/quave/ws/binge/node_modules/yargs/build/index.cjs:1:58539)
[Rspack Client Error] Error: config file "/Users/filipe/Documents/quave/ws/binge/web/node_modules/@meteorjs/rspack/rspack.config.js" not found.
at loadRspackConfig (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:658:75)
at RspackCLI.loadConfig (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:796:34)
at RspackCLI.createCompiler (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:680:50)
at Object.handler (/Users/filipe/Documents/quave/ws/binge/node_modules/@rspack/cli/dist/index.js:415:44)
Loading plugin `rspack` from package ... -
It never ends, 20 mins running already: