This seems odd. I’m running Meteor 3.4-beta.11 . I was on a branch where everything runs as expected.
In package.json, I updated this:
"react-router-dom": "^6.23.1",
… to this:
"react-router": "^7.9.3",
I didn’t expect react-router 7 to work yet because there are a lot of other changes to make to the code to update from react router 6 to 7. I expected to get a lot of react router error.
But instead, the client wouldn’t load, due to this unexpected and seemingly unrelated error:
In module.js:
} catch (error) {
console.error(`Error loading route module \`${route.module}\`, reloading page...`);
console.error(error);
if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
import.meta.hot) {
throw error;
}
window.location.reload();
return new Promise(()=>{});
}
…on the line:
import.meta.hot) {
throw error;
}
…I get the error:
Uncaught SyntaxError: Cannot use ‘import.meta’ outside a module (at modules.js?hash=81d9f1b41933efc36c207594a7a96b81aa72a01a:26920:20)
To further identify the file in which the error occurs, the first lines of the file are:
//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// Source maps are supported by all recent versions of Chrome, Safari, //
// and Firefox, and by Internet Explorer 11. //
// //
//////////////////////////////////////////////////////////////////////////
Package["core-runtime"].queue("modules",function () {/* Imports */
var Meteor = Package.meteor.Meteor;
var global = Package.meteor.global;
var meteorEnv = Package.meteor.meteorEnv;
var meteorInstall = Package['modules-runtime'].meteorInstall;
var verifyErrors = Package['modules-runtime'].verifyErrors;
var require = meteorInstall({"node_modules":{"meteor":{"modules":{"client.[.....]
Does that make any sense?