Support import.meta
I try use a new ES module but catch the error
SyntaxError: Cannot use 'import.meta' outside a module
W20221129-01:33:22.402(3)? (STDERR) at new Script (vm.js:102:7)
W20221129-01:33:22.402(3)? (STDERR) at createScript (vm.js:262:10)
W20221129-01:33:22.402(3)? (STDERR) at Object.runInThisContext (vm.js:310:10)
Try to recompile module
package.json:
"meteor": {
"mainModule": {
"client": "client/main.js",
"server": "server/main.js"
},
"nodeModules": {
"recompile": {
"your-esm-module": true
}
}
}
More info: https://github.com/meteor/meteor/blob/4442d0e0bf66d890c9dc1bf04f371cfcb82519d7/guide/source/using-npm-packages.md#recompiling-npm-packages
Thx, but I try to use external modern npm module and catch the error in the module
meteor npm i modern_module
It's not working for me
"meteor": {
"nodeModules": {
"recompile": {
"modern_module": true
}
}
}
Same problem
W20221129-11:00:25.589(3)? (STDERR) /Users/devpro/app/my_project/.meteor/local/build/programs/server/packages/modules.js:531
SyntaxError: Cannot use 'import.meta' outside a module
W20221129-01:33:22.402(3)? (STDERR) at new Script (vm.js:102:7)
W20221129-01:33:22.402(3)? (STDERR) at createScript (vm.js:262:10)
W20221129-01:33:22.402(3)? (STDERR) at Object.runInThisContext (vm.js:310:10)
I changed the issue name to make it more clear. Meteor has never supported import.meta, and is something we should add.
ok cool
Could you add the thing to the next release 2.9 ?
I have the same problem with a module that uses import.meta. I cannot use the new version of the module because of this. It would be great to have support for import.meta in future releases. Thanks.