SyntaxError: Unexpected identifier ‘getFormat’
at new Script (node:vm:117:7)
at createScript (node:vm:269:10)
at Object.runInThisContext (node:vm:317:10)
at /tools/static-assets/server/boot.js:414:32
at /tools/static-assets/server/boot.js:502:11
at Function.run (/tmp/meteor-test-run1q6cxtm.302vl/.meteor/local/build/programs/server/tools/tool-env/profile.ts:651:14)
at startServerProcess (/tools/static-assets/server/boot.js:501:17)
at Object. (/tools/static-assets/server/boot.js:506:2)
at Object. (/tools/static-assets/server/boot.js:510:4)
at Module. (node:internal/modules/cjs/loader:1688:14)
at Module.Mp._compile (/tools/static-assets/server/runtime.js:91:21)
at Object.Module._extensions…js (/tools/static-assets/server/runtime.js:125:21)
at Module. (node:internal/modules/cjs/loader:1423:32)
at Module.Mp.load (/tools/static-assets/server/runtime.js:35:31)
at Function._load (node:internal/modules/cjs/loader:1246:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
/tmp/meteor-test-run1q6cxtm.302vl/.meteor/local/build/programs/server/app/app.js:107086
Have you tried using the Meteor 3.4-rc.1 version I mentioned above, which bumps SWC to the latest and should include a swc_core version compatible with swc-plugin-coverage-instrument@0.0.32?
If not, and to help you further, I’d need a bit more to reproduce your issue. Could you provide a minimal reproduction repository where I can quickly see the problem and explore a fix?
Just want to say here that you don’t need to add rspack in your project when you upgrade to Meteor 3.4-rc.1. You can focus on test it first with the Meteor bundler as you had with Meteor 3.3.x. Updating to latest Meteor 3.4-rc.1 will ensure swc_core could be latest and have swc-plugin-coverage-instrument@0.0.32 hopefully.
I tried Meteor 3.4-rc.1 with Rspack integration and swc-plugin-coverage-instrument@0.0.32 without success. My tests fail with the following error.
It seems Rspack installed 1.6.5 (even 1.6.7) uses swc_core 46.0.3 and not the internal Meteor SWC 1.15.3.
ERROR in ./tests/main.js
× Module build failed (from builtin:swc-loader):
╰─▶ × plugin
│
│ x failed to invoke plugin on 'Some("/home/harry/Dev/VueGPX/tests/main.js")'
│ The version of the SWC Wasm plugin you're using might not be compatible with `builtin:swc-loader`.
│ The `swc_core` version of the current `rspack_core` is 46.0.3.
│ Please check the `swc_core` version of SWC Wasm plugin to make sure these versions are within the compatible range.
│ See this guide as a reference for selecting SWC Wasm plugin versions: https://rspack.rs/errors/swc-plugin-version
I see, the internal Meteor SWC was bumped to 1.15.3 in the last RC, which corresponds to swc_core v48.0.2.
It seems our internal Meteor SWC is now ahead of what Rspack uses, so this mismatch could be the issue. Keeping the internal Meteor SWC at the same or a lower version (swc_core 46.0.3) might solve it. Do you think this is the case?
I’m planning a quick rc.2 to include one fix, and I could add this one as well.
swc-plugin-coverage-instrument@0.0.32 need @sw/core 1.15.0 and above because it needs at least swc_core@47.0.0
But I do not know why it seems it is swc_core verson of Rspack that is taken into account.
Hopefully they announce Rspack 1.7.0 before we release 3.4 official, so we can set it as the minimum version. Though, we will need to verify stability with our test coverage, but at this point it may be better to focus on deliver this at 3.4.x series.
In any case, anyone can upgrade separately to rspack@1.7.0-beta.0, as you did, and make it work.