Open stephane303 opened 3 years ago
@stephane303 I'm experiencing the same issue. Have you found a workaround, by any chance?
PS: Maybe these tsconfig.json
settings are to restrictive:
In my project, we have them set to:
"target": "ES6",
"module": "ES2015",
cc @antfu: Writing import { useI18n } from 'vue-i18n-composable'
like in the example, causes the following error:
Failed to compile.
./node_modules/vue-i18n-composable/dist/index.mjs 17:17-25
Can't import the named export 'computed' from non EcmaScript module (only default export is available)
FWIW I also tried these workarounds, without success:
@stephane303 I'm experiencing the same issue. Have you found a workaround, by any chance?
PS: Maybe these
tsconfig.json
settings are to restrictive:In my project, we have them set to:
"target": "ES6", "module": "ES2015",
My workaround has been to copy the file https://github.com/intlify/vue-i18n-composable/blob/master/src/index.ts directly in my project, it's dirty, but its working
for example, you need to configure the following vue.config.js
:
module.exports = {
configureWebpack: (config) => {
config.module.rules.push({
test: /\.mjs$/,
type: 'javascript/auto',
})
},
}
In the example folder, I did an npm install and npm dev:
When doing the npm install I choose version 0.2.2 of vue-i18n-composable